From 1e6e5b299c235b513095a76a4cd9fffc41e8fc9c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 17 Jun 2002 18:36:36 +0000 Subject: beginning to sync up for 2.2.5 release.... --- source/lib/charcnv.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/lib/charcnv.c') diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index 2affa6a9e06..a4f90a5a10f 100644 --- a/source/lib/charcnv.c +++ b/source/lib/charcnv.c @@ -20,7 +20,8 @@ */ #include "includes.h" -#define CTRLZ 26 +#define CTRLZ 26 +#define SPC 32 static char cvtbuf[sizeof(pstring)]; @@ -58,8 +59,15 @@ static void setupmaps(void) /* Do not map undefined characters to some accidental code */ for (i = 128; i < 256; i++) { +#if 0 /* JERRY */ + /* Win2k & XP don't like the Ctrl-Z apparently */ + /* patch from Toomas.Soome@microlink.ee */ unix2dos[i] = CTRLZ; dos2unix[i] = CTRLZ; +#else + unix2dos[i] = SPC; + dos2unix[i] = SPC; +#endif } } @@ -400,6 +408,8 @@ char *unix2dos_format_static(const char *str) if (!mapsinited) initmaps(); + if (!str) + return NULL; for (p = str, dp = cvtbuf;*p && (dp - cvtbuf < sizeof(cvtbuf) - 1); p++,dp++) *dp = unix2dos[(unsigned char)*p]; *dp = 0; @@ -413,6 +423,8 @@ char *unix2dos_format(char *str) if (!mapsinited) initmaps(); + if (!str) + return NULL; for (p = str; *p; p++) *p = unix2dos[(unsigned char)*p]; return str; @@ -430,6 +442,8 @@ char *dos2unix_format_static(const char *str) if (!mapsinited) initmaps(); + if (!str) + return NULL; for (p = str, dp = cvtbuf;*p && (dp - cvtbuf < sizeof(cvtbuf) - 1); p++,dp++) *dp = dos2unix[(unsigned char)*p]; *dp = 0; @@ -443,6 +457,9 @@ char *dos2unix_format(char *str) if (!mapsinited) initmaps(); + if (!str) + return NULL; + for (p = str; *p; p++) *p = dos2unix[(unsigned char)*p]; return str; -- cgit