Fix com_stat() for arguments greater than one.
authorAndre Noll <maan@systemlinux.org>
Tue, 1 Apr 2008 21:26:22 +0000 (23:26 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 1 Apr 2008 21:26:22 +0000 (23:26 +0200)
It behaved like it was given a non-positive arg in this case.

command.c

index 458faf8..4eab9f6 100644 (file)
--- a/command.c
+++ b/command.c
@@ -335,7 +335,7 @@ int com_stat(int fd, int argc, char * const * argv)
                if (ret < 0)
                        goto out;
                ret = 1;
-               if (num == 1)
+               if (num > 0 && !--num)
                        goto out;
                sleep(50);
                if (getppid() == 1)