From e58fcf22b9ba4b08c9529e656617e06f7cd13516 Mon Sep 17 00:00:00 2001 From: andersen Date: Fri, 22 Dec 2000 18:02:02 +0000 Subject: Cleanup from Gennady Feldman git-svn-id: svn://busybox.net/trunk/busybox@1490 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- sh.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sh.c') 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 } -- cgit v1.2.3-55-g6feb