mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +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>
|
2004-09-26 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
* pipethrough.c: #include <string.h> to compile on Solaris.
|
* 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. */
|
/* Linux declares environ in <unistd.h>, so don't repeat it here. */
|
||||||
#if !defined(__linux__)
|
#if (!(defined(__linux__) && defined (__USE_GNU)))
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
#endif
|
#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 */
|
/* Convert "\E" -> esc character and ^x to control-x key and ^^ to ^ key */
|
||||||
/* Returns a newly allocated string */
|
/* Returns a newly allocated string */
|
||||||
char *convert_controls (char *s)
|
char *convert_controls (const char *s)
|
||||||
{
|
{
|
||||||
char *valcopy = g_strdup (s);
|
char *valcopy = g_strdup (s);
|
||||||
char *p, *q;
|
const char *p;
|
||||||
|
char *q;
|
||||||
|
|
||||||
/* Parse the escape special character */
|
/* Parse the escape special character */
|
||||||
for (p = s, q = valcopy; *p;){
|
for (p = s, q = valcopy; *p;){
|
||||||
@ -1038,9 +1039,10 @@ char *convert_controls (char *s)
|
|||||||
if (*p == '^')
|
if (*p == '^')
|
||||||
*q++ = *p++;
|
*q++ = *p++;
|
||||||
else {
|
else {
|
||||||
*p = (*p | 0x20);
|
char c = (*p | 0x20);
|
||||||
if (*p >= 'a' && *p <= 'z') {
|
if (c >= 'a' && c <= 'z') {
|
||||||
*q++ = *p++ - 'a' + 1;
|
*q++ = c - 'a' + 1;
|
||||||
|
p++;
|
||||||
} else
|
} else
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user