diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-04-05 23:00:47 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-04-05 23:00:47 +0000 |
commit | a9ca2d252c254da9b901a9a3afeb3fff1d497d2f (patch) | |
tree | d0b6fab76b2d04d9fe09a3158cd82d40ed4317b7 /shell | |
parent | b2fd787922a62ebfd39468c971097cdf55e3ca42 (diff) | |
download | busybox-w32-a9ca2d252c254da9b901a9a3afeb3fff1d497d2f.tar.gz busybox-w32-a9ca2d252c254da9b901a9a3afeb3fff1d497d2f.tar.bz2 busybox-w32-a9ca2d252c254da9b901a9a3afeb3fff1d497d2f.zip |
Add support of /W prompts
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@2265 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index e317b86fa..a3710812f 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -441,6 +441,19 @@ static void parse_prompt(const char *prmt_ptr) | |||
441 | add_to_prompt(&prmt_mem_ptr, &alm, &prmt_len, pwd_buf); | 441 | add_to_prompt(&prmt_mem_ptr, &alm, &prmt_len, pwd_buf); |
442 | continue; | 442 | continue; |
443 | #endif | 443 | #endif |
444 | case 'W': | ||
445 | if (pwd_buf[0] == 0) { | ||
446 | char *z; | ||
447 | |||
448 | getcwd(pwd_buf, PATH_MAX); | ||
449 | z = strrchr(pwd_buf,'/'); | ||
450 | if ( (z != NULL) && (z != pwd_buf) ) { | ||
451 | z++; | ||
452 | strcpy(pwd_buf,z); | ||
453 | } | ||
454 | } | ||
455 | add_to_prompt(&prmt_mem_ptr, &alm, &prmt_len, pwd_buf); | ||
456 | continue; | ||
444 | case '!': | 457 | case '!': |
445 | snprintf(buf, sizeof(buf), "%d", num_ok_lines); | 458 | snprintf(buf, sizeof(buf), "%d", num_ok_lines); |
446 | add_to_prompt(&prmt_mem_ptr, &alm, &prmt_len, buf); | 459 | add_to_prompt(&prmt_mem_ptr, &alm, &prmt_len, buf); |