diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2004-07-21 10:20:19 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2004-07-21 10:20:19 +0000 |
commit | 28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4 (patch) | |
tree | c2404007a5a2043b7959b4acacb4d617ec33c6d5 | |
parent | a88ae491e3422b7ea37a00a63ed2d2c439b535d2 (diff) | |
download | busybox-w32-28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4.tar.gz busybox-w32-28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4.tar.bz2 busybox-w32-28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4.zip |
Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled.
-rw-r--r-- | shell/ash.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/shell/ash.c b/shell/ash.c index da78965ea..fd616ef4a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -5954,33 +5954,6 @@ varunset(const char *end, const char *var, const char *umsg, int varflags) | |||
5954 | static void pushfile(void); | 5954 | static void pushfile(void); |
5955 | 5955 | ||
5956 | /* | 5956 | /* |
5957 | * Read a line from the script. | ||
5958 | */ | ||
5959 | |||
5960 | static inline char * | ||
5961 | pfgets(char *line, int len) | ||
5962 | { | ||
5963 | char *p = line; | ||
5964 | int nleft = len; | ||
5965 | int c; | ||
5966 | |||
5967 | while (--nleft > 0) { | ||
5968 | c = pgetc2(); | ||
5969 | if (c == PEOF) { | ||
5970 | if (p == line) | ||
5971 | return NULL; | ||
5972 | break; | ||
5973 | } | ||
5974 | *p++ = c; | ||
5975 | if (c == '\n') | ||
5976 | break; | ||
5977 | } | ||
5978 | *p = '\0'; | ||
5979 | return line; | ||
5980 | } | ||
5981 | |||
5982 | |||
5983 | /* | ||
5984 | * Read a character from the script, returning PEOF on end of file. | 5957 | * Read a character from the script, returning PEOF on end of file. |
5985 | * Nul characters in the input are silently discarded. | 5958 | * Nul characters in the input are silently discarded. |
5986 | */ | 5959 | */ |
@@ -6024,6 +5997,33 @@ static inline int pgetc2(void) | |||
6024 | } | 5997 | } |
6025 | #endif | 5998 | #endif |
6026 | 5999 | ||
6000 | /* | ||
6001 | * Read a line from the script. | ||
6002 | */ | ||
6003 | |||
6004 | static inline char * | ||
6005 | pfgets(char *line, int len) | ||
6006 | { | ||
6007 | char *p = line; | ||
6008 | int nleft = len; | ||
6009 | int c; | ||
6010 | |||
6011 | while (--nleft > 0) { | ||
6012 | c = pgetc2(); | ||
6013 | if (c == PEOF) { | ||
6014 | if (p == line) | ||
6015 | return NULL; | ||
6016 | break; | ||
6017 | } | ||
6018 | *p++ = c; | ||
6019 | if (c == '\n') | ||
6020 | break; | ||
6021 | } | ||
6022 | *p = '\0'; | ||
6023 | return line; | ||
6024 | } | ||
6025 | |||
6026 | |||
6027 | 6027 | ||
6028 | #ifdef CONFIG_FEATURE_COMMAND_EDITING | 6028 | #ifdef CONFIG_FEATURE_COMMAND_EDITING |
6029 | static const char *cmdedit_prompt; | 6029 | static const char *cmdedit_prompt; |