From 1fda201493617e6994bbe5e15a2dd7c3a00f1a21 Mon Sep 17 00:00:00 2001
From: Marcus Comstedt <marcus@mc.pp.se>
Date: Thu, 17 Apr 1997 18:42:43 +0200
Subject: [PATCH] char signedness fix.

Rev: src/modules/MIME/configure.in:1.2
Rev: src/modules/MIME/mime.c:1.6
---
 src/modules/MIME/configure.in |  2 ++
 src/modules/MIME/mime.c       | 18 ++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/modules/MIME/configure.in b/src/modules/MIME/configure.in
index e0d24b4b20..d07bdf5e55 100644
--- a/src/modules/MIME/configure.in
+++ b/src/modules/MIME/configure.in
@@ -3,4 +3,6 @@ AC_CONFIG_HEADER(config.h)
 
 sinclude(../module_configure.in)
 
+AC_C_CHAR_UNSIGNED
+
 AC_OUTPUT(Makefile,echo FOO >stamp-h )
diff --git a/src/modules/MIME/mime.c b/src/modules/MIME/mime.c
index e232879d14..9be70705b0 100644
--- a/src/modules/MIME/mime.c
+++ b/src/modules/MIME/mime.c
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.c,v 1.5 1997/04/11 23:01:43 marcus Exp $
+ * $Id: mime.c,v 1.6 1997/04/17 16:42:43 marcus Exp $
  *
  * RFC1521 functionality for Pike
  *
@@ -9,7 +9,7 @@
 #include "config.h"
 
 #include "global.h"
-RCSID("$Id: mime.c,v 1.5 1997/04/11 23:01:43 marcus Exp $");
+RCSID("$Id: mime.c,v 1.6 1997/04/17 16:42:43 marcus Exp $");
 #include "stralloc.h"
 #include "types.h"
 #include "pike_macros.h"
@@ -19,6 +19,12 @@ RCSID("$Id: mime.c,v 1.5 1997/04/11 23:01:43 marcus Exp $");
 #include "builtin_functions.h"
 #include "error.h"
 
+#ifdef __CHAR_UNSIGNED__
+#define SIGNED signed
+#else
+#define SIGNED
+#endif
+
 
 /** Forward declarations of functions implementing Pike functions **/
 
@@ -36,9 +42,9 @@ static void f_quote( INT32 args );
 /** Global tables **/
 
 static char base64tab[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static char base64rtab[0x80-' '];
+static SIGNED char base64rtab[0x80-' '];
 static char qptab[16] = "0123456789ABCDEF";
-static char qprtab[0x80-'0'];
+static SIGNED char qprtab[0x80-'0'];
 
 #define CT_CTL     0
 #define CT_WHITE   1
@@ -136,7 +142,7 @@ static void f_decode_base64( INT32 args )
        instead. */
 
     dynamic_buffer buf;
-    char *src;
+    SIGNED char *src;
     INT32 cnt, d = 1;
     int pads = 0;
 
@@ -275,7 +281,7 @@ static void f_decode_qp( INT32 args )
        so we'll use a dynamic buffer to hold the result. */
 
     dynamic_buffer buf;
-    char *src;
+    SIGNED char *src;
     INT32 cnt;
 
     buf.s.str=NULL;
-- 
GitLab