/* Globals that are static to this file */
-static char *cwd;
+static const char *cwd;
static char *local_pending_command = NULL;
static struct jobset job_list = { NULL, NULL };
static int argc;
printf("cd: %s: %m\n", newdir);
return EXIT_FAILURE;
}
- cwd = xgetcwd(cwd);
+ cwd = xgetcwd((char *)cwd);
if (!cwd)
cwd = unknown;
return EXIT_SUCCESS;
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog *dummy)
{
- cwd = xgetcwd(cwd);
+ cwd = xgetcwd((char *)cwd);
if (!cwd)
cwd = unknown;
- printf( "%s\n", cwd);
+ puts(cwd);
return EXIT_SUCCESS;
}
if (v == NULL) {
char **e;
for (e = environ; *e; e++) {
- printf( "%s\n", *e);
+ puts(*e);
}
return 0;
}
res = putenv(v);
if (res)
fprintf(stderr, "export: %m\n");
-#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_FANCY_PROMPT
if (strncmp(v, "PS1=", 4)==0)
PS1 = getenv("PS1");
#endif
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
PS1 = NULL;
#else
PS1 = getenv("PS1");
static inline void setup_prompt_string(char **prompt_str)
{
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
/* Set up the prompt */
if (shell_context == 0) {
if (PS1)
else
var = itoa(last_bg_pid);
break;
- /* Everything else like $$, $#, $[0-9], etc should all be
+ /* Everything else like $$, $#, $[0-9], etc. should all be
* expanded by wordexp(), so we can in theory skip that stuff
- * here, but just to be on the safe side (i.e. since uClibc
+ * here, but just to be on the safe side (i.e., since uClibc
* wordexp doesn't do this stuff yet), lets leave it in for
* now. */
case '$':