Search
lxdream.org :: lxdream/src/lxpaths.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxpaths.c
changeset 1283:2cbafe321d6f
prev1205:a486ac64f34b
next1286:8376a612a79d
author nkeynes
date Tue Mar 27 17:39:05 2012 +1000 (10 years ago)
permissions -rw-r--r--
last change Treat quotes as entering a double-quoted string (mostly redundant, but we
generate them in the path escaping for some reason)
file annotate diff log raw
1.1 --- a/src/lxpaths.c Mon Jan 30 20:11:08 2012 +1000
1.2 +++ b/src/lxpaths.c Tue Mar 27 17:39:05 2012 +1000
1.3 @@ -79,6 +79,7 @@
1.4 d = result;
1.5 e = result+sizeof(result)-1;
1.6 s = input;
1.7 + gboolean inDQstring = FALSE;
1.8
1.9 if( input == NULL )
1.10 return NULL;
1.11 @@ -137,11 +138,20 @@
1.12 } else {
1.13 *d++ = '\\';
1.14 }
1.15 + } else if( c == '\"' ) {
1.16 + /* Unescaped double-quotes start a DQ string. Although we treat the
1.17 + * string as if it were double-quoted for most purposes anyway, so
1.18 + * this has little effect.
1.19 + */
1.20 + inDQstring = !inDQstring;
1.21 } else {
1.22 *d++ = c;
1.23 }
1.24 }
1.25 *d = '\0';
1.26 + if( inDQstring ) {
1.27 + WARN( "Unterminated double-quoted string '%s'", input );
1.28 + }
1.29 return g_strdup(result);
1.30 }
1.31 gchar *get_absolute_path( const gchar *in_path )
.