Command skill accepted earlier command name as argument. This did
not work since commit
991b8a94f0354a128085c7411713e17282c4e04a.
Reported-By: "Anne C. Hanna" <orion@ugcs.caltech.edu>
Bug-Debian: http://bugs.debian.org/659038
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
argv += optind;
for (i = 0; i < argc; i++) {
- ENLIST(pid, strtol_or_err(argv[0],
- _("failed to parse argument")));
- pid_count++;
+ long num;
+ char *end = NULL;
+ errno = 0;
+ num = strtol(argv[0], &end, 10);
+ if (errno == 0 && argv[0] != end && end != NULL && *end == '\0') {
+ ENLIST(pid, num);
+ pid_count++;
+ } else {
+ ENLIST(cmd, argv[0]);
+ }
argv++;
}