aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.c
diff options
context:
space:
mode:
authorGravatar liljencrantz <liljencrantz@gmail.com>2007-10-06 20:51:31 +1000
committerGravatar liljencrantz <liljencrantz@gmail.com>2007-10-06 20:51:31 +1000
commitfcd474afe8ec02b6f605bbd69bc96c77804fe19e (patch)
treed3d94911b4d367942345c4adacdedbe0c22db45c /common.c
parent3ca3b6209d0da6f233ed71c6c03ec6bfc4dd71fc (diff)
Make completion system not use quoted string escapes, since it generally looks a bit confusing there
darcs-hash:20071006105131-75c98-af770878124cc19946b964c0cf772818a5bf4216.gz
Diffstat (limited to 'common.c')
-rw-r--r--common.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common.c b/common.c
index a0a7323e..a138ae2f 100644
--- a/common.c
+++ b/common.c
@@ -719,10 +719,13 @@ static wchar_t *escape_simple( const wchar_t *in )
wchar_t *escape( const wchar_t *in_orig,
- int escape_all )
+ int flags )
{
const wchar_t *in = in_orig;
+ int escape_all = flags & ESCAPE_ALL;
+ int no_quoted = flags & ESCAPE_NO_QUOTED;
+
wchar_t *out;
wchar_t *pos;
@@ -735,7 +738,7 @@ wchar_t *escape( const wchar_t *in_orig,
FATAL_EXIT();
}
- if( wcslen( in ) == 0 )
+ if( !no_quoted && (wcslen( in ) == 0) )
{
out = wcsdup(L"''");
if( !out )
@@ -884,7 +887,7 @@ wchar_t *escape( const wchar_t *in_orig,
Use quoted escaping if possible, since most people find it
easier to read.
*/
- if( need_escape && !need_complex_escape && escape_all )
+ if( !no_quoted && need_escape && !need_complex_escape && escape_all )
{
free( out );
out = escape_simple( in_orig );