* Original copyright notice is retained at the end of this file.
*/
+#include "busybox.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <sys/wait.h>
#include "cmdedit.h"
-#include "busybox.h"
/* Conditional use of "register" keyword */
#endif /* MSHDEBUG */
+#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+# define DEFAULT_ROOT_PROMPT "\\u:\\w> "
+# define DEFAULT_USER_PROMPT "\\u:\\w$ "
+#else
+# define DEFAULT_ROOT_PROMPT "# "
+# define DEFAULT_USER_PROMPT "$ "
+#endif
+
+
/* -------- sh.h -------- */
/*
* shell
#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
if (prompt->value == null)
#endif
- setval(prompt, "$ ");
+ setval(prompt, DEFAULT_USER_PROMPT);
if (geteuid() == 0) {
- setval(prompt, "# ");
+ setval(prompt, DEFAULT_ROOT_PROMPT);
prompt->status &= ~EXPORT;
}
cprompt = lookup("PS2");
static void initarea()
{
- brkaddr = malloc(AREASIZE);
+ brkaddr = xmalloc(AREASIZE);
brktop = brkaddr + AREASIZE;
while ((long) sbrk(0) & ALIGN)
} else {
/* put non-interactive processes into a different process group.
* we don't support jobs, but this is at least sane: see Bug 659 */
- setpgrp();
+ bb_setpgrp;
}
if (t->type == TPAREN)