diff --git a/src/ChangeLog b/src/ChangeLog index 5b7c93a33..f1071d062 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-09-27 Andrew V. Samoilov + + * complete.c [__linux__ && !__USE_GNU]: Fix compilation on Red Hat 7.3 + * util.c (convert_controls): Fix compilation. + 2004-09-26 Roland Illig * pipethrough.c: #include to compile on Solaris. diff --git a/src/complete.c b/src/complete.c index ce350bddf..60042dda0 100644 --- a/src/complete.c +++ b/src/complete.c @@ -218,7 +218,7 @@ username_completion_function (char *text, int state) } /* Linux declares environ in , so don't repeat it here. */ -#if !defined(__linux__) +#if (!(defined(__linux__) && defined (__USE_GNU))) extern char **environ; #endif diff --git a/src/util.c b/src/util.c index 8c24765a4..2fffcf9ca 100644 --- a/src/util.c +++ b/src/util.c @@ -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++; }