aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-03-06 11:50:12 +1000
committerGravatar axel <axel@liljencrantz.se>2006-03-06 11:50:12 +1000
commit91ab6441735b42085ee87a6ce862b06b72bf6af1 (patch)
treea180125a25ce7c9cdf2eb89e344fb6e55180a4d1
parent083fcd6491e8255bad976d4af5ec065d47ab6aac (diff)
Add support for \\ in quoted strings
darcs-hash:20060306015012-ac50b-a510764b624d1e4416d134f5b92532e046a6125b.gz
-rw-r--r--common.c2
-rw-r--r--doc_src/doc.hdr9
2 files changed, 7 insertions, 4 deletions
diff --git a/common.c b/common.c
index c86cfcb4..42e7f54f 100644
--- a/common.c
+++ b/common.c
@@ -1154,6 +1154,7 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
{
switch( in[++in_pos] )
{
+ case '\\':
case L'\'':
{
in[out_pos]=in[in_pos];
@@ -1211,6 +1212,7 @@ wchar_t *unescape( const wchar_t * orig, int unescape_special )
return 0;
}
+ case '\\':
case L'$':
case '"':
{
diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr
index 1eeca9f3..ba9456fd 100644
--- a/doc_src/doc.hdr
+++ b/doc_src/doc.hdr
@@ -72,10 +72,11 @@ quoted string, <a href='#expand-variable'>variable expansion</a> still
takes place. Other than that, a quoted parameter will not be parameter
expanded, may contain spaces, and escape sequences are ignored. The
only backslash escape accepted within single quotes is \\', which
-escapes a single quote. The only backslash escapes accepted within
-double quotes are \\", which escapes a double quote, and \\$, which
-escapes a dollar character. Single quotes have no special meaning
-withing double quotes and vice versa.
+escapes a single quote and \\\\, which escapes the backslash
+symbol. The only backslash escapes accepted within double quotes are
+\\", which escapes a double quote, \\$, which escapes a dollar
+character, and \\\\, which escapes the backslash symbol. Single quotes
+have no special meaning withing double quotes and vice versa.
Example: