github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jneitzel / v6shell

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Wiki (4)
  • Graphs
  • Tag: release.osh-20100228

click here to add a description

click here to add a homepage

  • Switch Branches (15)
    • master
    • osh-20070321
    • osh-20070324
    • osh-20070707
    • osh-20080109
    • osh-20080629
    • osh-20081026
    • osh-20081122
    • osh-20081213
    • osh-20090527
    • osh-20091029
    • osh-20091122
    • osh-20091127
    • osh-20091218
    • osh-20100228
  • Switch Tags (14)
    • release.osh-20100228
    • release.osh-20091218
    • release.osh-20091127
    • release.osh-20091122
    • release.osh-20091029
    • osh-20090527
    • osh-20081213
    • osh-20081122
    • osh-20081026
    • osh-20080629
    • osh-20080109
    • osh-20070707
    • osh-20070324
    • osh-20070321
  • Branch List
Sending Request…

V6 Thompson Shell Port — Read more

  Cancel

http://v6shell.org/

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Zero out GIT.LOG & remove reference to it from C* files. 
jneitzel (author)
Sun Feb 28 13:31:43 -0800 2010
commit  7ee5017cf6f41b7c24427b7b785e9447a64925a2
tree    ebf57dd05fa7228d1668f5c052e9cb867258ec7d
parent  eae731f5b068d7b0576d7cbe3bcf487df15ec7fe
v6shell / util.c util.c
100644 688 lines (602 sloc) 15.949 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
/*
* util.c - special built-in shell utilities for osh
*/
/*-
* Copyright (c) 2004-2010
* Jeffrey Allen Neitzel <jan (at) v6shell (dot) org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY JEFFREY ALLEN NEITZEL ``AS IS'', AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JEFFREY ALLEN NEITZEL BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @(#)$Id$
*/
/*
* Derived from: osh-20080629
* fd2.c (r404 2008-05-09 16:52:15Z jneitzel)
* goto.c (r465 2008-06-25 22:11:58Z jneitzel)
* if.c (r465 2008-06-25 22:11:58Z jneitzel)
*/
/*-
* Copyright (C) Caldera International Inc. 2001-2002. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code and documentation must retain the above
* copyright notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed or owned by Caldera
* International, Inc.
* 4. Neither the name of Caldera International, Inc. nor the names of other
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
* INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
* INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
 
#define OSH_SHELL
 
#include "defs.h"
#include "err.h"
#include "pexec.h"
#include "sh.h"
 
#define IS_SBI(k) \
((k) == SBI_ECHO || (k) == SBI_FD2 || (k) == SBI_GOTO || (k) == SBI_IF)
 
static int sbi_echo(int, char **);
/*@maynotreturn@*/
static int sbi_fd2(int, char **);
/*@maynotreturn@*/
static int sbi_goto(int, char **);
/*@maynotreturn@*/
static int sbi_if(int, char **);
 
/*
* Execute the shell utility specified by key w/ the argument
* count ac and the argument vector pointed to by av. Return
* status s of the last call in the chain on success. Do not
* return on invalid-utility error.
*/
int
uexec(enum sbikey key, int ac, char **av)
{
int (*util)(int, char **);
int r;
static int cnt, cnt1, s;
 
if (cnt == 0) setmyerrexit(&ut_errexit);
 
switch (key) {
case SBI_ECHO: util = &sbi_echo; break;
case SBI_FD2: util = &sbi_fd2; break;
case SBI_GOTO: util = &sbi_goto; break;
case SBI_IF: util = &sbi_if; break;
default:
err(FC_ERR, FMT2S, getmyname(), "uexec: Invalid utility");
/*NOTREACHED*/
return FC_ERR;
}
 
cnt1 = cnt++;
 
r = (*util)(ac, av);
 
if (cnt-- > cnt1)
s = r;
 
#ifdef DEBUG
if (cnt == 0) fd_print(FD2, "uexec: return %d;\n", s);
#endif
 
return s;
}
 
/*
* NAME
* echo - write arguments to standard output
*
* SYNOPSIS
* echo [-n] [string ...]
*
* DESCRIPTION
* Echo writes its string arguments (if any) separated by
* blanks and terminated by a newline to the standard output.
* If `-n' is specified, the terminating newline is not written.
*/
static int
sbi_echo(int argc, char **argv)
{
bool nopt;
char **avp, **ave;
 
argc--, argv++;
if (*argv != NULL && EQUAL(*argv, "-n")) {
argc--, argv++;
nopt = true;
} else
nopt = false;
 
for (avp = argv, ave = &argv[argc]; avp < ave; avp++)
fd_print(FD1, "%s%s", *avp, (avp + 1 < ave) ? " " : "");
if (!nopt)
fd_print(FD1, FMT1S, "");
 
return SH_TRUE;
}
 
/*@noreturn@*/
static void fd2_usage(void);
 
/*
* NAME
* fd2 - redirect from/to file descriptor 2
*
* SYNOPSIS
* fd2 [-e] [-f file] command [arg ...]
*
* DESCRIPTION
* See the fd2(1) manual page for full details.
*/
static int
sbi_fd2(int argc, char **argv)
{
bool eopt;
enum sbikey key;
int efd, nfd, ofd, opt;
char *file;
 
setmyname(argv[0]);
 
ofd = FD1, efd = FD2;
eopt = false, file = NULL;
while ((opt = getopt(argc, argv, ":ef:")) != -1)
switch (opt) {
case 'e':
eopt = true;
break;
case 'f':
file = optarg;
break;
default:
fd2_usage();
}
argc -= optind;
argv += optind;
if (argc < 1)
fd2_usage();
 
if (file != NULL) {
if ((nfd = open(file, O_WRONLY|O_APPEND|O_CREAT, 0666)) == -1)
err(FC_ERR, FMT3S, getmyname(), file, ERR_CREATE);
if (dup2(nfd, efd) == -1)
err(FC_ERR, FMT2S, getmyname(), strerror(errno));
if (eopt && dup2(efd, ofd) == -1)
err(FC_ERR, FMT2S, getmyname(), strerror(errno));
(void)close(nfd);
} else {
if (eopt)
ofd = FD2, efd = FD1;
if (dup2(ofd, efd) == -1)
err(FC_ERR, FMT2S, getmyname(), strerror(errno));
}
 
/*
* Try to execute the specified command.
*/
key = cmd_lookup(argv[0]);
if (IS_SBI(key))
return uexec(key, argc, argv);
 
(void)err_pexec(argv[0], argv);
/*NOTREACHED*/
return FC_ERR;
}
 
static void
fd2_usage(void)
{
 
err(FC_ERR,"usage: %s [-e] [-f file] command [arg ...]\n",getmyname());
}
 
static off_t offset;
 
static bool getlabel(/*@out@*/ char *, int, size_t);
static int xgetc(void);
 
/*
* NAME
* goto - transfer command
*
* SYNOPSIS
* goto label [...]
*
* DESCRIPTION
* See the goto(1) manual page for full details.
*/
static int
sbi_goto(int argc, char **argv)
{
size_t siz;
char label[LABELMAX];
 
setmyname(argv[0]);
 
if (argc < 2 || *argv[1] == EOS || isatty(FD0) != 0)
err(FC_ERR, FMT2S, getmyname(), ERR_GENERIC);
if ((siz = strlen(argv[1]) + 1) > sizeof(label))
err(FC_ERR, FMT3S, getmyname(), argv[1], ERR_LABTOOLONG);
if (lseek(FD0, (off_t)0, SEEK_SET) == -1)
err(FC_ERR, FMT2S, getmyname(), ERR_SEEK);
 
while (getlabel(label, *argv[1] & 0377, siz))
if (strcmp(label, argv[1]) == 0) {
(void)lseek(FD0, offset, SEEK_SET);
return SH_TRUE;
}
 
fd_print(FD2, FMT3S, getmyname(), argv[1], ERR_LABNOTFOUND);
return SH_FALSE;
}
 
/*
* Search for the first occurrence of a possible label with both
* the same first character (fc) and the same length (siz - 1)
* as argv[1], and copy this possible label to buf.
* Return true (1) if possible label found.
* Return false (0) at end-of-file.
*/
static bool
getlabel(char *buf, int fc, size_t siz)
{
int c;
char *b;
 
while ((c = xgetc()) != EOF) {
/* `:' may be preceded by blanks. */
while (c == SPACE || c == TAB)
c = xgetc();
if (c != COLON) {
while (c != EOL && c != EOF)
c = xgetc();
continue;
}
 
/* Prepare for possible label. */
while ((c = xgetc()) == SPACE || c == TAB)
; /* nothing */
if (c != fc) /* not label */
continue;
 
/*
* Try to copy possible label (first word only)
* to buf, ignoring it if it becomes too long.
*/
b = buf;
do {
if (c == EOL || c == SPACE || c == TAB || c == EOF) {
*b = EOS;
break;
}
*b = c;
c = xgetc();
} while (++b < &buf[siz]);
 
/* Ignore any remaining characters on labelled line. */
while (c != EOL && c != EOF)
c = xgetc();
if (c == EOF)
break;
 
if ((size_t)(b - buf) != siz - 1) /* not label */
continue;
return true;
}
 
*buf = EOS;
return false;
}
 
/*
* If not at end-of-file, return the next character from the standard
* input as an unsigned char converted to an int while incrementing
* the global offset. Otherwise, return EOF at end-of-file.
*/
static int
xgetc(void)
{
int nc;
 
offset++;
nc = getchar();
return (nc != EOF) ? nc & 0377 : EOF;
}
 
static int iac;
static int iap;
static char **iav;
 
/*@maynotreturn@*/
static void doex(bool);
static bool e1(void);
static bool e2(void);
static bool e3(void);
static bool equal(/*@null@*/ const char *, /*@null@*/ const char *);
static bool expr(void);
static bool ifaccess(/*@null@*/ const char *, int);
static bool ifstat1(/*@null@*/ const char *, mode_t);
static bool ifstat2(/*@null@*/ const char *, /*@null@*/ const char *, int);
/*@null@*/
static char *nxtarg(bool);
 
/*
* NAME
* if - conditional command
*
* SYNOPSIS
* if expression [command [arg ...]]
*
* DESCRIPTION
* See the if(1) manual page for full details.
*/
static int
sbi_if(int argc, char **argv)
{
bool re; /* return value of expr() */
 
setmyname(argv[0]);
 
if (argc > 1) {
iac = argc;
iav = argv;
iap = 1;
re = expr();
if (re && iap < iac)
doex(!FORKED);
} else
re = false;
 
return re ? SH_TRUE : SH_FALSE;
}
 
/*
* Evaluate the expression.
* Return true (1) or false (0).
*/
static bool
expr(void)
{
bool re;
 
re = e1();
if (equal(nxtarg(RETERR), "-o"))
return re | expr();
iap--;
return re;
}
 
static bool
e1(void)
{
bool re;
 
re = e2();
if (equal(nxtarg(RETERR), "-a"))
return re & e1();
iap--;
return re;
}
 
static bool
e2(void)
{
 
if (equal(nxtarg(RETERR), "!"))
return !e3();
iap--;
return e3();
}
 
static bool
e3(void)
{
bool re;
pid_t cpid, tpid;
int cstat, d;
char *a, *b;
 
if ((a = nxtarg(RETERR)) == NULL)
err(FC_ERR, FMT3S, getmyname(), iav[iap - 2], ERR_EXPR);
 
/*
* Deal w/ parentheses for grouping.
*/
if (equal(a, "(")) {
re = expr();
if (!equal(nxtarg(RETERR), ")"))
err(FC_ERR, FMT3S, getmyname(), a, ERR_PAREN);
return re;
}
 
/*
* Execute { command [arg ...] } to obtain its exit status.
*/
if (equal(a, "{")) {
if ((cpid = fork()) == -1)
err(FC_ERR, FMT2S, getmyname(), ERR_FORK);
if (cpid == 0)
/**** Child! ****/
doex(FORKED);
else {
/**** Parent! ****/
tpid = wait(&cstat);
while ((a = nxtarg(RETERR)) != NULL && !equal(a, "}"))
; /* nothing */
if (a == NULL)
iap--;
return (tpid == cpid && cstat == 0) ? true : false;
}
}
 
/*
* file existence/permission tests
*/
if (equal(a, "-e"))
return ifaccess(nxtarg(!RETERR), F_OK);
if (equal(a, "-r"))
return ifaccess(nxtarg(!RETERR), R_OK);
if (equal(a, "-w"))
return ifaccess(nxtarg(!RETERR), W_OK);
if (equal(a, "-x"))
return ifaccess(nxtarg(!RETERR), X_OK);
 
/*
* file existence/type tests
*/
if (equal(a, "-d"))
return ifstat1(nxtarg(!RETERR), S_IFDIR);
if (equal(a, "-f"))
return ifstat1(nxtarg(!RETERR), S_IFREG);
if (equal(a, "-h"))
return ifstat1(nxtarg(!RETERR), S_IFLNK);
if (equal(a, "-s"))
return ifstat1(nxtarg(!RETERR), F_GZ);
if (equal(a, "-t")) {
/* Does the descriptor refer to a terminal device? */
b = nxtarg(RETERR);
if (b == NULL || *b == EOS)
err(FC_ERR, FMT3S, getmyname(), a, ERR_DIGIT);
if (*b >= '0' && *b <= '9' && *(b + 1) == EOS) {
d = *b - '0';
if (IS_DIGIT(d, *b))
return isatty(d) != 0;
}
err(FC_ERR, FMT3S, getmyname(), b, ERR_NOTDIGIT);
}
 
/*
* binary comparisons
*/
if ((b = nxtarg(RETERR)) == NULL)
err(FC_ERR, FMT3S, getmyname(), a, ERR_OPERATOR);
if (equal(b, "="))
return equal(a, nxtarg(!RETERR));
if (equal(b, "!="))
return !equal(a, nxtarg(!RETERR));
if (equal(b, "-ot"))
return ifstat2(a, nxtarg(!RETERR), F_OT);
if (equal(b, "-nt"))
return ifstat2(a, nxtarg(!RETERR), F_NT);
if (equal(b, "-ef"))
return ifstat2(a, nxtarg(!RETERR), F_EF);
err(FC_ERR, FMT3S, getmyname(), b, ERR_OPUNKNOWN);
/*NOTREACHED*/
return false;
}
 
static void
doex(bool forked)
{
enum sbikey xak;
char **xap, **xav;
 
if (iap < 2 || iap > iac) /* should never (but can) be true */
err(FC_ERR, FMT2S, getmyname(), ERR_AVIINVAL);
 
xav = xap = &iav[iap];
while (*xap != NULL) {
if (forked && equal(*xap, "}"))
break;
xap++;
}
if (forked && xap - xav > 0 && !equal(*xap, "}"))
err(FC_ERR, FMT3S, getmyname(), iav[iap - 1], ERR_BRACE);
*xap = NULL;
if (xav[0] == NULL) {
if (forked)
err(FC_ERR, FMT3S, getmyname(), iav[iap - 1], ERR_COMMAND);
else
/* Currently unreachable; do not remove. */
err(FC_ERR, FMT2S, getmyname(), ERR_COMMAND);
}
 
/* Invoke a special "exit" utility in this case. */
if (equal(xav[0], "exit")) {
(void)lseek(FD0, (off_t)0, SEEK_END);
_exit(SH_TRUE);
}
 
xak = cmd_lookup(xav[0]);
if (IS_SBI(xak)) {
if (forked)
_exit(uexec(xak, (int)(xap - xav), xav));
else
(void)uexec(xak, (int)(xap - xav), xav);
return;
}
 
(void)err_pexec(xav[0], xav);
}
 
/*
* Check access permission for file according to mode while
* dealing w/ special cases for the superuser and `-x':
* - Always grant search access on directories.
* - If not a directory, require at least one execute bit.
* Return true (1) if access is granted.
* Return false (0) if access is denied.
*/
static bool
ifaccess(const char *file, int mode)
{
struct stat sb;
bool ra;
 
if (file == NULL || *file == EOS)
return false;
 
ra = access(file, mode) == 0;
 
if (ra && mode == X_OK && sheuid == 0) {
if (stat(file, &sb) < 0)
ra = false;
else if (S_ISDIR(sb.st_mode))
ra = true;
else
ra = (sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0;
}
 
return ra;
}
 
static bool
ifstat1(const char *file, mode_t type)
{
struct stat sb;
bool rs;
 
if (file == NULL || *file == EOS)
return false;
 
if (type == S_IFLNK) {
if (lstat(file, &sb) < 0)
rs = false;
else
rs = (sb.st_mode & S_IFMT) == type;
} else if (stat(file, &sb) < 0)
rs = false;
else if (type == S_IFDIR || type == S_IFREG)
rs = (sb.st_mode & S_IFMT) == type;
else if (type == F_GZ)
rs = sb.st_size > (off_t)0;
else
rs = false;
 
return rs;
}
 
static bool
ifstat2(const char *file1, const char *file2, int act)
{
struct stat sb1, sb2;
bool rs;
 
if (file1 == NULL || *file1 == EOS)
return false;
if (file2 == NULL || *file2 == EOS)
return false;
 
if (stat(file1, &sb1) < 0)
return false;
if (stat(file2, &sb2) < 0)
return false;
 
if (act == F_OT)
rs = sb1.st_mtime < sb2.st_mtime;
else if (act == F_NT)
rs = sb1.st_mtime > sb2.st_mtime;
else if (act == F_EF)
rs = sb1.st_dev == sb2.st_dev && sb1.st_ino == sb2.st_ino;
else
rs = false;
 
return rs;
}
 
static char *
nxtarg(bool reterr)
{
char *nap;
 
if (iap < 1 || iap > iac) /* should never (but can) be true */
err(FC_ERR, FMT2S, getmyname(), ERR_AVIINVAL);
 
if (iap == iac) {
if (reterr) {
iap++;
return NULL;
}
err(FC_ERR, FMT3S, getmyname(), iav[iap - 1], ERR_ARGUMENT);
}
nap = iav[iap];
iap++;
return nap;
}
 
static bool
equal(const char *a, const char *b)
{
 
if (a == NULL || b == NULL)
return false;
return EQUAL(a, b);
}
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server