Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled.
This commit is contained in:
parent
a88ae491e3
commit
28939ade2d
54
shell/ash.c
54
shell/ash.c
@ -5953,33 +5953,6 @@ varunset(const char *end, const char *var, const char *umsg, int varflags)
|
||||
|
||||
static void pushfile(void);
|
||||
|
||||
/*
|
||||
* Read a line from the script.
|
||||
*/
|
||||
|
||||
static inline char *
|
||||
pfgets(char *line, int len)
|
||||
{
|
||||
char *p = line;
|
||||
int nleft = len;
|
||||
int c;
|
||||
|
||||
while (--nleft > 0) {
|
||||
c = pgetc2();
|
||||
if (c == PEOF) {
|
||||
if (p == line)
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
*p++ = c;
|
||||
if (c == '\n')
|
||||
break;
|
||||
}
|
||||
*p = '\0';
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read a character from the script, returning PEOF on end of file.
|
||||
* Nul characters in the input are silently discarded.
|
||||
@ -6024,6 +5997,33 @@ static inline int pgetc2(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Read a line from the script.
|
||||
*/
|
||||
|
||||
static inline char *
|
||||
pfgets(char *line, int len)
|
||||
{
|
||||
char *p = line;
|
||||
int nleft = len;
|
||||
int c;
|
||||
|
||||
while (--nleft > 0) {
|
||||
c = pgetc2();
|
||||
if (c == PEOF) {
|
||||
if (p == line)
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
*p++ = c;
|
||||
if (c == '\n')
|
||||
break;
|
||||
}
|
||||
*p = '\0';
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_FEATURE_COMMAND_EDITING
|
||||
static const char *cmdedit_prompt;
|
||||
|
Loading…
Reference in New Issue
Block a user