summaryrefslogtreecommitdiffstats
path: root/source/lib/charcnv.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-06-17 18:36:36 +0000
committerGerald Carter <jerry@samba.org>2002-06-17 18:36:36 +0000
commit1e6e5b299c235b513095a76a4cd9fffc41e8fc9c (patch)
tree9f741529073ad411cc7328334e26d3e35b1d33f1 /source/lib/charcnv.c
parenta11c5d7ad07d259d764aede4745d13f8163a8212 (diff)
downloadsamba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.gz
samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.xz
samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.zip
beginning to sync up for 2.2.5 release....
Diffstat (limited to 'source/lib/charcnv.c')
-rw-r--r--source/lib/charcnv.c19
1 files changed, 18 insertions, 1 deletions
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;