2 more compilation error



Hello, Roland.

It seems you introduced 2 more compilation errors ;-(

Here is unistd.h environ declaration in Red Hat 7.3:

#ifdef __USE_GNU
extern char **environ;
#endif

P.S. It becames a bad tradition...

-- 
Regards,
Andrew V. Samoilov.
src/ChangeLog:

2004-09-27  Andrew V. Samoilov  <sav bcs zp ua>

	* complete.c [__linux__ && !__USE_GNU]: Fix compilation on Red Hat 7.3
	* util.c (convert_controls): Fix compilation.

--- util.c.rol	Mon Sep 27 09:26:33 2004
+++ util.c	Mon Sep 27 11:45:54 2004
@@ -1019,10 +1019,11 @@ void wipe_password (char *passwd)
 
 /* Convert "\E" -> esc character and ^x to control-x key and ^^ to ^ key */
 /* Returns a newly allocated string */
-char *convert_controls (char *s)
+char *convert_controls (const char *s)
 {
     char *valcopy = g_strdup (s);
-    char *p, *q;
+    const char *p;
+    char *q;
 
     /* Parse the escape special character */
     for (p = s, q = valcopy; *p;){
@@ -1038,9 +1039,10 @@ char *convert_controls (char *s)
 		if (*p == '^')
 		    *q++ = *p++;
 		else {
-		    *p = (*p | 0x20);
-		    if (*p >= 'a' && *p <= 'z') {
-		        *q++ = *p++ - 'a' + 1;
+		    char c = (*p | 0x20);
+		    if (c >= 'a' && c <= 'z') {
+		        *q++ = c - 'a' + 1;
+			p++;
 		    } else
 		        p++;
 		}
@@ -220,3 +215,3 @@ username_completion_function (char *text
 /* Linux declares environ in <unistd.h>, so don't repeat it here. */
-#if !defined(__linux__)
+#if !(defined(__linux__) && defined (__USE_GNU))
 extern char **environ;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]