aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-13 13:32:30 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-13 13:32:30 +0000
commit5d8d4a674bb8ff31688340cd53ee58d55267dd0b (patch)
treec56d093a50a7ccbefddb74392a7040d20e342796
parent65a0730c9fffa67249c248a83f1f2188cb84f9ea (diff)
downloadbusybox-w32-5d8d4a674bb8ff31688340cd53ee58d55267dd0b.tar.gz
busybox-w32-5d8d4a674bb8ff31688340cd53ee58d55267dd0b.tar.bz2
busybox-w32-5d8d4a674bb8ff31688340cd53ee58d55267dd0b.zip
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 941582704..c75571a01 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -3,7 +3,7 @@
3 * pidof implementation for busybox 3 * pidof implementation for busybox
4 * 4 *
5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen 5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 6 * Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
35 35
36extern int pidof_main(int argc, char **argv) 36extern int pidof_main(int argc, char **argv)
37{ 37{
38 int opt; 38 int opt, n = 0;
39 39
40 40
41 /* do normal option parsing */ 41 /* do normal option parsing */
@@ -66,7 +66,7 @@ extern int pidof_main(int argc, char **argv)
66 } 66 }
67 67
68 for(; pidList && *pidList!=0; pidList++) { 68 for(; pidList && *pidList!=0; pidList++) {
69 printf("%ld ", (long)*pidList); 69 printf("%s%ld", (n++ ? " " : ""), (long)*pidList);
70 } 70 }
71 /* Note that we don't bother to free the memory 71 /* Note that we don't bother to free the memory
72 * allocated in find_pid_by_name(). It will be freed 72 * allocated in find_pid_by_name(). It will be freed