aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorGravatar "Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-26 13:24:45 +0000
committerGravatar "Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-26 13:24:45 +0000
commit11d7c52912eb2a767d7134a79d731acd9aa3e8ef (patch)
tree66099af1d6b438a528bbcb965023c6f2e164aaf0 /shell
parent5f46010ab7caa8a6e93b703ec5001b2b809877ad (diff)
downloadbusybox-11d7c52912eb2a767d7134a79d731acd9aa3e8ef.tar.gz
busybox-11d7c52912eb2a767d7134a79d731acd9aa3e8ef.tar.bz2
correct set prompt if CONFIG_ASH_EXPAND_PRMT enabled, small automatic space->tabs convert by my personal editor
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 7271535aa..559238c3f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6016,10 +6016,19 @@ pfgets(char *line, int len)
#ifdef CONFIG_FEATURE_COMMAND_EDITING
+#ifdef CONFIG_ASH_EXPAND_PRMT
+static char *cmdedit_prompt;
+#else
static const char *cmdedit_prompt;
+#endif
static inline void putprompt(const char *s)
{
+#ifdef CONFIG_ASH_EXPAND_PRMT
+ free(cmdedit_prompt);
+ cmdedit_prompt = bb_xstrdup(s);
+#else
cmdedit_prompt = s;
+#endif
}
#else
static inline void putprompt(const char *s)
@@ -12626,7 +12635,7 @@ readcmd(int argc, char **argv)
while ((i = nextopt("p:r")) != '\0')
#endif
{
- switch(i) {
+ switch(i) {
case 'p':
prompt = optionarg;
break;
@@ -12643,13 +12652,13 @@ readcmd(int argc, char **argv)
#endif
#if defined(CONFIG_ASH_READ_TIMEOUT)
case 't':
- ts.tv_sec = strtol(optionarg, &p, 10);
+ ts.tv_sec = strtol(optionarg, &p, 10);
ts.tv_usec = 0;
if (*p == '.') {
char *p2;
if (*++p) {
int scale;
- ts.tv_usec = strtol(p, &p2, 10);
+ ts.tv_usec = strtol(p, &p2, 10);
if (*p2)
error("invalid timeout");
scale = p2 - p;