mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* complete.c [__linux__ && !__USE_GNU]: Fix compilation on Red Hat 7.3
* util.c (convert_controls): Fix compilation.
This commit is contained in:
parent
c47cd9de68
commit
49117d0f31
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
12
src/util.c
12
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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user