summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2002-04-13 13:32:30 +0000
committerEric Andersen2002-04-13 13:32:30 +0000
commit5d8d4a674bb8ff31688340cd53ee58d55267dd0b (patch)
treec56d093a50a7ccbefddb74392a7040d20e342796
parent65a0730c9fffa67249c248a83f1f2188cb84f9ea (diff)
downloadbusybox-5d8d4a674bb8ff31688340cd53ee58d55267dd0b.zip
busybox-5d8d4a674bb8ff31688340cd53ee58d55267dd0b.tar.gz
Patch from Jim Treadway <jim@stardot-tech.com> to teach
pidof to not add trailing spaces when not needed.
-rw-r--r--procps/pidof.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/procps/pidof.c b/procps/pidof.c
index 9415827..c75571a 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -3,7 +3,7 @@
* pidof implementation for busybox
*
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
extern int pidof_main(int argc, char **argv)
{
- int opt;
+ int opt, n = 0;
/* do normal option parsing */
@@ -66,7 +66,7 @@ extern int pidof_main(int argc, char **argv)
}
for(; pidList && *pidList!=0; pidList++) {
- printf("%ld ", (long)*pidList);
+ printf("%s%ld", (n++ ? " " : ""), (long)*pidList);
}
/* Note that we don't bother to free the memory
* allocated in find_pid_by_name(). It will be freed