author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Mon, 19 Sep 2016 00:22:44 -0700 | |
changeset 6954 | bdf0b42d8cef |
parent 5903 | 9b224fd0d790 |
permissions | -rw-r--r-- |
5903
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
1 |
This patch was developed in-house. |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
2 |
It is submitted upstream at https://github.com/apple/cups/issues/4813 |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
3 |
|
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
4 |
--- systemv/lp.c Wed Mar 23 11:59:25 2016 |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
5 |
+++ systemv/lp.c Fri Mar 25 22:52:26 2016 |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
6 |
@@ -39,7 +39,87 @@ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
7 |
int set_job_attrs(const char *command, int job_id, int num_options, |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
8 |
cups_option_t *options); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
9 |
|
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
10 |
+/* |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
11 |
+ * Transform combined arguments into separate list so that the option |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
12 |
+ * handling in main() can handle those properly. |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
13 |
+ * For example: |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
14 |
+ * lp -U user -csdprinter file1 |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
15 |
+ * would be converted to |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
16 |
+ * lp -U user -c -s -dprinter file |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
17 |
+ * |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
18 |
+ * The logic used to determine the end of option is same as in main(), |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
19 |
+ * so that option handling in main() wouldn't upset. |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
20 |
+ */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
21 |
+static int |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
22 |
+parseargs(int *acp, char **avp[]) |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
23 |
+{ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
24 |
+ int c, i, j; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
25 |
+ int argc, ac, eos; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
26 |
+ char **argv, **av; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
27 |
+ int end_options = 0; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
28 |
|
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
29 |
+ argc = *acp; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
30 |
+ argv = *avp; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
31 |
+ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
32 |
+ j = argc + 1; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
33 |
+ for (i = 1; i < argc; i++) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
34 |
+ if (argv[i][0] == '-') |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
35 |
+ j += strlen(argv[i]); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
36 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
37 |
+ if ((av = malloc(sizeof (char *) * j)) == NULL) |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
38 |
+ return (1); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
39 |
+ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
40 |
+ av[0] = argv[0]; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
41 |
+ ac = 1; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
42 |
+ for (i = 1; i < argc; i++) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
43 |
+ if (end_options || argv[i][0] != '-' || argv[i][1] == '\0') { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
44 |
+ av[ac++] = argv[i]; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
45 |
+ continue; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
46 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
47 |
+ eos = 0; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
48 |
+ for (j = 1; (c = argv[i][j]) != '\0'; j++) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
49 |
+ switch (c) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
50 |
+ case 'U': case 'd': case 'f': case 'h': |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
51 |
+ case 'i': case 'n': case 'o': case 'p': |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
52 |
+ case 'q': case 't': case 'y': case 'H': |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
53 |
+ case 'P': case 'S': case 'T': |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
54 |
+ /* take option argument */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
55 |
+ (void) asprintf(&av[ac], "-%s", &argv[i][j]); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
56 |
+ ac++; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
57 |
+ /* option argument may be on the next */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
58 |
+ if (argv[i][j + 1] == '\0') { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
59 |
+ /* copy only if it's available */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
60 |
+ if ((i + 1) < argc) |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
61 |
+ av[ac++] = argv[++i]; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
62 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
63 |
+ eos = 1; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
64 |
+ break; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
65 |
+ case '-': |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
66 |
+ av[ac++] = argv[i]; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
67 |
+ end_options = 1; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
68 |
+ eos = 1; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
69 |
+ break; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
70 |
+ default: |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
71 |
+ (void) asprintf(&av[ac], "-%c", c); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
72 |
+ ac++; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
73 |
+ break; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
74 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
75 |
+ if (eos) |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
76 |
+ break; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
77 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
78 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
79 |
+ av[ac] = NULL; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
80 |
+ for (i = 1; i < ac; i++) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
81 |
+ /* asprintf might have failed with ENOMEM */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
82 |
+ if (av[i] == NULL) |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
83 |
+ return (1); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
84 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
85 |
+ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
86 |
+ *acp = ac; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
87 |
+ *avp = av; |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
88 |
+ return (0); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
89 |
+} |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
90 |
+ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
91 |
/* |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
92 |
* 'main()' - Parse options and send files for printing. |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
93 |
*/ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
94 |
@@ -65,6 +145,10 @@ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
95 |
int silent; /* Silent or verbose output? */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
96 |
char buffer[8192]; /* Copy buffer */ |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
97 |
|
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
98 |
+ if (parseargs(&argc, &argv)) { |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
99 |
+ _cupsLangPrintf(stderr, _("Unable to allocate memory!")); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
100 |
+ return (1); |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
101 |
+ } |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
102 |
|
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
103 |
#ifdef __sun |
9b224fd0d790
20608333 UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs
srikantha pandrahalli<srikantha.pandrahalli@oracle.com>
parents:
diff
changeset
|
104 |
/* |