[git commit master] top, ps: do not output trailing spaces
Denys Vlasenko
vda.linux at googlemail.com
Fri Sep 11 21:29:45 UTC 2009
commit: http://git.busybox.net/busybox/commit/?id=ae357bd7138a179a1433b7d6e1aca48cc6438966
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
include/usage.h | 2 +-
libbb/procps.c | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/usage.h b/include/usage.h
index 907eb78..6f9d155 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1338,7 +1338,7 @@
#define ftpd_trivial_usage \
"[-wvS] [-t N] [-T N] [DIR]"
#define ftpd_full_usage "\n\n" \
- "FTP server\n" \
+ "Anonymous FTP server\n" \
"\n" \
"ftpd should be used as an inetd service.\n" \
"ftpd's line for inetd.conf:\n" \
diff --git a/libbb/procps.c b/libbb/procps.c
index 307d8d6..9a8e42d 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -471,6 +471,8 @@ void FAST_FUNC read_cmdline(char *buf, int col, unsigned pid, const char *comm)
sz = open_read_close(filename, buf, col);
if (sz > 0) {
buf[sz] = '\0';
+ while (--sz >= 0 && buf[sz] == '\0')
+ continue;
while (--sz >= 0)
if ((unsigned char)(buf[sz]) < ' ')
buf[sz] = ' ';
--
1.6.3.3
More information about the busybox-cvs
mailing list