@@ -30,8 +30,11 @@ struct Table<'a> {
30
30
}
31
31
impl < ' a > Table < ' a > {
32
32
fn new ( path : & str , file : Option < & str > , filemode : & str , skip : Option < & ' a str > ) -> Table < ' a > {
33
+ let mut ownpath = String :: from ( path) ;
34
+ if !ownpath. starts_with ( "/" ) { ownpath. insert ( 0 , '/' ) ; }
35
+ if ownpath. ends_with ( "/" ) { ownpath. pop ( ) ; }
33
36
Table {
34
- path : String :: from ( path ) ,
37
+ path : ownpath ,
35
38
file : match file {
36
39
None => RefCell :: new ( Box :: new ( stdout ( ) ) ) ,
37
40
Some ( ref file) => RefCell :: new ( Box :: new (
@@ -127,7 +130,7 @@ fn gml_to_ewkb(cell: &RefCell<String>, coll: &[Geometry], bbox: Option<&BBox>, m
127
130
2 => 32 , // Indicate EWKB where the srid follows this byte
128
131
3 => 32 | 128 , // Add bit to indicate the presence of Z values
129
132
_ => {
130
- eprintln ! ( "GML number of dimensions {} not supported" , geom. dims) ;
133
+ eprintln ! ( "Warning: GML number of dimensions {} not supported" , geom. dims) ;
131
134
32
132
135
}
133
136
} ;
@@ -182,8 +185,10 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, filemode: &str, skip: Opt
182
185
for col in colspec {
183
186
let name = col[ "name" ] . as_str ( ) . unwrap_or_else ( || fatalerr ! ( "Error: column has no 'name' entry in configuration file" ) ) ;
184
187
let colpath = col[ "path" ] . as_str ( ) . unwrap_or_else ( || fatalerr ! ( "Error: column has no 'path' entry in configuration file" ) ) ;
185
- let mut path = String :: from ( rowpath) ;
188
+ let mut path = String :: from ( & table. path ) ;
189
+ if !colpath. starts_with ( "/" ) { path. push ( '/' ) ; }
186
190
path. push_str ( colpath) ;
191
+ if path. ends_with ( "/" ) { path. pop ( ) ; }
187
192
let subtable: Option < Table > = match col[ "cols" ] . is_badvalue ( ) {
188
193
true => None ,
189
194
false => {
0 commit comments