LIBBB_MSRC=libbb/messages.c
LIBBB_MESSAGES= full_version name_too_long omitting_directory not_a_directory \
memory_exhausted invalid_date invalid_option io_error dash_dash_help \
-write_error too_few_args name_longer_than_foo
+write_error too_few_args name_longer_than_foo unknown
LIBBB_MOBJ=$(patsubst %,$(LIBBB)/%.o, $(LIBBB_MESSAGES))
char c;
char *pbuf;
+ if (!pwd_buf) {
+ pwd_buf=unknown;
+ }
+
while (*prmt_ptr) {
pbuf = buf;
pbuf[1] = 0;
return EXIT_FAILURE;
}
cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
return EXIT_SUCCESS;
}
static int builtin_pwd(struct child_prog *dummy)
{
cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
puts(cwd);
return EXIT_SUCCESS;
}
/* initialize the cwd -- this is never freed...*/
cwd = xgetcwd(0);
+ if (!cwd)
+ cwd = unknown;
#ifdef BB_FEATURE_COMMAND_EDITING
cmdedit_set_initial_prompt();
#else
extern const char * const write_error;
extern const char * const too_few_args;
extern const char * const name_longer_than_foo;
+extern const char * const unknown;
#endif /* __LIBBB_H__ */
return EXIT_FAILURE;
}
cwd = xgetcwd(cwd);
-
+ if (!cwd)
+ cwd = unknown;
return EXIT_SUCCESS;
}
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog *dummy)
{
+ cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
printf( "%s\n", cwd);
return EXIT_SUCCESS;
}
{
if (cwd) {
free(cwd);
- cwd = NULL;
}
if (local_pending_command)
free(local_pending_command);
/* initialize the cwd -- this is never freed...*/
cwd = xgetcwd(0);
+ if (!cwd)
+ cwd = unknown;
#ifdef BB_FEATURE_CLEAN_UP
atexit(free_memory);
extern const char * const write_error;
extern const char * const too_few_args;
extern const char * const name_longer_than_foo;
+extern const char * const unknown;
#endif /* __LIBBB_H__ */
#ifdef L_name_longer_than_foo
const char * const name_longer_than_foo = "Names longer than %d chars not supported.";
#endif
+#ifdef L_unknown
+ const char * const unknown = "(unknown)";
+#endif
char c;
char *pbuf;
+ if (!pwd_buf) {
+ pwd_buf=unknown;
+ }
+
while (*prmt_ptr) {
pbuf = buf;
pbuf[1] = 0;
return EXIT_FAILURE;
}
cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
return EXIT_SUCCESS;
}
static int builtin_pwd(struct child_prog *dummy)
{
cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
puts(cwd);
return EXIT_SUCCESS;
}
/* initialize the cwd -- this is never freed...*/
cwd = xgetcwd(0);
+ if (!cwd)
+ cwd = unknown;
#ifdef BB_FEATURE_COMMAND_EDITING
cmdedit_set_initial_prompt();
#else
return EXIT_FAILURE;
}
cwd = xgetcwd(cwd);
-
+ if (!cwd)
+ cwd = unknown;
return EXIT_SUCCESS;
}
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog *dummy)
{
+ cwd = xgetcwd(cwd);
+ if (!cwd)
+ cwd = unknown;
printf( "%s\n", cwd);
return EXIT_SUCCESS;
}
{
if (cwd) {
free(cwd);
- cwd = NULL;
}
if (local_pending_command)
free(local_pending_command);
/* initialize the cwd -- this is never freed...*/
cwd = xgetcwd(0);
+ if (!cwd)
+ cwd = unknown;
#ifdef BB_FEATURE_CLEAN_UP
atexit(free_memory);