From df4fdf33c435317ab84ecc0fbd4580760991765a Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Wed, 26 Sep 2007 02:19:59 +1000 Subject: [PATCH] Make escaping of the empty string return two quotes instead of the empty string darcs-hash:20070925161959-75c98-1a0409c5fd12c7570e54cbdd9201548c7405196b.gz --- common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.c b/common.c index b9b4e9139..7a0504751 100644 --- a/common.c +++ b/common.c @@ -739,6 +739,15 @@ wchar_t *escape( const wchar_t *in_orig, debug( 0, L"%s called with null input", __func__ ); FATAL_EXIT(); } + + if( wcslen( in ) == 0 ) + { + out = wcsdup(L"''"); + if( !out ) + DIE_MEM(); + return out; + } + out = malloc( sizeof(wchar_t)*(wcslen(in)*4 + 1)); pos = out;