aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-07-21 10:20:19 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-07-21 10:20:19 +0000
commit28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4 (patch)
treec2404007a5a2043b7959b4acacb4d617ec33c6d5 /shell
parenta88ae491e3422b7ea37a00a63ed2d2c439b535d2 (diff)
downloadbusybox-28939ade2dbfdf5e970ed66a79f2a004ac8eb4b4.tar.gz
Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled.
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)
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;