aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-22 18:02:02 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-22 18:02:02 +0000
commit2d5b64273fb10938f963ea845bf558b55c3884fa (patch)
tree7a470ffead9aec7702b319d30fb86dd44c988cd6 /sh.c
parenta9819b290848e0a760f3805d5937fa050235d707 (diff)
downloadbusybox-2d5b64273fb10938f963ea845bf558b55c3884fa.tar.gz
Cleanup from Gennady Feldman <gfeldman@mail.com>
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sh.c b/sh.c
index a47ff5ca2..14571169b 100644
--- a/sh.c
+++ b/sh.c
@@ -807,14 +807,8 @@ static int get_command(FILE * source, char *command)
signal(SIGWINCH, SIG_DFL);
return 0;
#else
- i=strlen(cwd);
- i--;
- if (i>1){
- while ((i>0) && (*(cwd+i)!='/') ) i--;
- if (*(cwd+i)=='/') i++;
- }
-
- fprintf(stdout, "[%s@%s %s]%s",user, buf, (cwd+i), prompt);
+ fprintf(stdout, "[%s@%s %s]%s",user, buf,
+ get_last_path_component(cwd), prompt);
fflush(stdout);
#endif
}