From c2e8cb49d9601294686940adaaf5fe40c75be465 Mon Sep 17 00:00:00 2001 From: Jamie Gritton Date: Thu, 8 Jul 2010 19:22:52 +0000 Subject: [PATCH] Properly recognize a number followed by non-digits as a jail name. Call "0" a name because zero is used to indicate no specified jid. MFC after: 3 days --- usr.sbin/jls/jls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c index a3a23b77936..2c1655b771e 100644 --- a/usr.sbin/jls/jls.c +++ b/usr.sbin/jls/jls.c @@ -84,8 +84,10 @@ main(int argc, char **argv) break; case 'j': jid = strtoul(optarg, &ep, 10); - if (!*optarg || *ep) + if (!jid || *ep) { + jid = 0; jname = optarg; + } break; case 'h': pflags = (pflags & ~(PRINT_SKIP | PRINT_VERBOSE)) |