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

* util.c (convert_controls): Fix compilation.
This commit is contained in:
Roland Illig 2004-09-27 11:26:53 +00:00
parent c47cd9de68
commit 49117d0f31
3 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
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.
2004-09-26 Roland Illig <roland.illig@gmx.de>
* pipethrough.c: #include <string.h> to compile on Solaris.

View File

@ -218,7 +218,7 @@ username_completion_function (char *text, int state)
}
/* Linux declares environ in <unistd.h>, so don't repeat it here. */
#if !defined(__linux__)
#if (!(defined(__linux__) && defined (__USE_GNU)))
extern char **environ;
#endif

View File

@ -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++;
}