Deleted Added
full compact
30c30
< __FBSDID("$FreeBSD: head/usr.bin/at/at.c 96216 2002-05-08 11:23:45Z kuriyama $");
---
> __FBSDID("$FreeBSD: head/usr.bin/at/at.c 96701 2002-05-16 00:47:14Z tjr $");
123c123
< static void list_jobs(void);
---
> static void list_jobs(long *, int);
125a126,127
> static int in_job_list(long, long *, int);
> static long *get_job_list(int, char *[], int *);
447a450,461
> static int
> in_job_list(long job, long *joblist, int len)
> {
> int i;
>
> for (i = 0; i < len; i++)
> if (job == joblist[i])
> return 1;
>
> return 0;
> }
>
449c463
< list_jobs()
---
> list_jobs(long *joblist, int len)
494a509,512
> /* If jobs are given, only list those jobs */
> if (joblist && !in_job_list(jobno, joblist, len))
> continue;
>
667a686,710
> static long *
> get_job_list(int argc, char *argv[], int *joblen)
> {
> int i, len;
> long *joblist;
> char *ep;
>
> joblist = NULL;
> len = argc;
> if (len > 0) {
> if ((joblist = malloc(len * sizeof(*joblist))) == NULL)
> panic("out of memory");
>
> for (i = 0; i < argc; i++) {
> errno = 0;
> if ((joblist[i] = strtol(argv[i], &ep, 10)) < 0 ||
> ep == argv[i] || *ep != '\0' || errno)
> panic("invalid job number");
> }
> }
>
> *joblen = len;
> return joblist;
> }
>
678a722,723
> long *joblist;
> int joblen;
679a725,726
> joblist = NULL;
> joblen = 0;
758c805
< options = "q:v";
---
> options = "q:";
790c837,839
< list_jobs();
---
> if (queue_set == 0)
> joblist = get_job_list(argc - optind, argv + optind, &joblen);
> list_jobs(joblist, joblen);