aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-07-21 10:20:19 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-07-21 10:20:19 +0000
commit75c53ccd61532a2467c281a3780b712b4d70f58f (patch)
treec2404007a5a2043b7959b4acacb4d617ec33c6d5 /shell
parent3196cba280299b81889b321e71f8de430769cde0 (diff)
downloadbusybox-w32-75c53ccd61532a2467c281a3780b712b4d70f58f.tar.gz
busybox-w32-75c53ccd61532a2467c281a3780b712b4d70f58f.tar.bz2
busybox-w32-75c53ccd61532a2467c281a3780b712b4d70f58f.zip
Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled. git-svn-id: svn://busybox.net/trunk/busybox@8991 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c54
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)
5954static void pushfile(void); 5954static void pushfile(void);
5955 5955
5956/* 5956/*
5957 * Read a line from the script.
5958 */
5959
5960static inline char *
5961pfgets(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
6004static inline char *
6005pfgets(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
6029static const char *cmdedit_prompt; 6029static const char *cmdedit_prompt;