ash: fix off-by-one in "jobs %4" handling. closes 7310
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 8 Sep 2014 15:21:52 +0000 (17:21 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 8 Sep 2014 15:21:52 +0000 (17:21 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 293f15147854f8d63a890fe98dc5aba4cfe38362..705fe9fa4af91de95533a5efd1ab1a504ef35757 100644 (file)
@@ -3647,7 +3647,7 @@ getjob(const char *name, int getctl)
 
        if (is_number(p)) {
                num = atoi(p);
-               if (num < njobs) {
+               if (num <= njobs) {
                        jp = jobtab + num - 1;
                        if (jp->used)
                                goto gotit;