| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: base-wrapper.c,v 1.3 2016/11/27 11:46:45 joerg Exp $ */ | | 1 | /* $NetBSD: base-wrapper.c,v 1.4 2017/01/12 14:56:35 joerg Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. | | 4 | * Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code was developed as part of Google's Summer of Code 2007 program. | | 7 | * This code was developed as part of Google's Summer of Code 2007 program. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * | | 12 | * |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -61,45 +61,45 @@ libtool_mode(struct arglist *args) | | | @@ -61,45 +61,45 @@ libtool_mode(struct arglist *args) |
61 | mode = NULL; | | 61 | mode = NULL; |
62 | TAILQ_FOREACH(arg, args, link) { | | 62 | TAILQ_FOREACH(arg, args, link) { |
63 | if (arg->val[0] != '-') { | | 63 | if (arg->val[0] != '-') { |
64 | prepend_after = arg; | | 64 | prepend_after = arg; |
65 | break; | | 65 | break; |
66 | } | | 66 | } |
67 | if (strncmp(arg->val, "--mode=", 7) == 0) { | | 67 | if (strncmp(arg->val, "--mode=", 7) == 0) { |
68 | mode = arg->val + 7; | | 68 | mode = arg->val + 7; |
69 | continue; | | 69 | continue; |
70 | } | | 70 | } |
71 | if (strcmp(arg->val, "--mode") == 0) { | | 71 | if (strcmp(arg->val, "--mode") == 0) { |
72 | arg = TAILQ_NEXT(arg, link); | | 72 | arg = TAILQ_NEXT(arg, link); |
73 | if (arg == NULL || *arg->val == '-') | | 73 | if (arg == NULL || *arg->val == '-') |
74 | errx(255, "Misssing --mode argument"); | | 74 | errx(255, "Missing --mode argument"); |
75 | mode = arg->val; | | 75 | mode = arg->val; |
76 | continue; | | 76 | continue; |
77 | } | | 77 | } |
78 | if (strcmp(arg->val, "--finish") == 0) { | | 78 | if (strcmp(arg->val, "--finish") == 0) { |
79 | mode = arg->val + 2; | | 79 | mode = arg->val + 2; |
80 | continue; | | 80 | continue; |
81 | } | | 81 | } |
82 | if (strcmp(arg->val, "--tag") == 0) { | | 82 | if (strcmp(arg->val, "--tag") == 0) { |
83 | arg = TAILQ_NEXT(arg, link); | | 83 | arg = TAILQ_NEXT(arg, link); |
84 | if (arg == NULL || *arg->val == '-') | | 84 | if (arg == NULL || *arg->val == '-') |
85 | errx(255, "Misssing --tag argument"); | | 85 | errx(255, "Missing --tag argument"); |
86 | continue; | | 86 | continue; |
87 | } | | 87 | } |
88 | } | | 88 | } |
89 | if (arg == NULL) | | 89 | if (arg == NULL) |
90 | return 1; | | 90 | return 1; |
91 | if (mode == NULL) | | 91 | if (mode == NULL) |
92 | errx(255, "Misssing --mode=XXX"); | | 92 | errx(255, "Missing --mode=XXX"); |
93 | | | 93 | |
94 | if (strcmp(mode, "compile") == 0 || | | 94 | if (strcmp(mode, "compile") == 0 || |
95 | strcmp(mode, "link") == 0) | | 95 | strcmp(mode, "link") == 0) |
96 | return 0; | | 96 | return 0; |
97 | else | | 97 | else |
98 | return 1; | | 98 | return 1; |
99 | } | | 99 | } |
100 | #endif | | 100 | #endif |
101 | | | 101 | |
102 | int | | 102 | int |
103 | main(int argc, char **argv) | | 103 | main(int argc, char **argv) |
104 | { | | 104 | { |
105 | extern char **environ; | | 105 | extern char **environ; |