aboutsummaryrefslogtreecommitdiff
path: root/shell/lash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/lash.c')
-rw-r--r--shell/lash.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/shell/lash.c b/shell/lash.c
index a47ff5ca2..14571169b 100644
--- a/shell/lash.c
+++ b/shell/lash.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
}