Deleted Added
full compact
options.c (265772) options.c (265773)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/options.c 265772 2014-05-09 13:27:30Z jilles $");
39__FBSDID("$FreeBSD: head/bin/sh/options.c 265773 2014-05-09 13:32:36Z jilles $");
40
41#include <signal.h>
42#include <unistd.h>
43#include <stdlib.h>
44
45#include "shell.h"
46#define DEFINE_OPTIONS
47#include "options.h"

--- 421 unchanged lines hidden (view full) ---

469 for (q = optstr; *q != c; ) {
470 if (*q == '\0') {
471 if (optstr[0] == ':') {
472 s[0] = c;
473 s[1] = '\0';
474 err |= setvarsafe("OPTARG", s, 0);
475 }
476 else {
40
41#include <signal.h>
42#include <unistd.h>
43#include <stdlib.h>
44
45#include "shell.h"
46#define DEFINE_OPTIONS
47#include "options.h"

--- 421 unchanged lines hidden (view full) ---

469 for (q = optstr; *q != c; ) {
470 if (*q == '\0') {
471 if (optstr[0] == ':') {
472 s[0] = c;
473 s[1] = '\0';
474 err |= setvarsafe("OPTARG", s, 0);
475 }
476 else {
477 out1fmt("Illegal option -%c\n", c);
477 out2fmt_flush("Illegal option -%c\n", c);
478 INTOFF;
479 (void) unsetvar("OPTARG");
480 INTON;
481 }
482 c = '?';
483 goto bad;
484 }
485 if (*++q == ':')

--- 4 unchanged lines hidden (view full) ---

490 if (*p == '\0' && (p = **optnext) == NULL) {
491 if (optstr[0] == ':') {
492 s[0] = c;
493 s[1] = '\0';
494 err |= setvarsafe("OPTARG", s, 0);
495 c = ':';
496 }
497 else {
478 INTOFF;
479 (void) unsetvar("OPTARG");
480 INTON;
481 }
482 c = '?';
483 goto bad;
484 }
485 if (*++q == ':')

--- 4 unchanged lines hidden (view full) ---

490 if (*p == '\0' && (p = **optnext) == NULL) {
491 if (optstr[0] == ':') {
492 s[0] = c;
493 s[1] = '\0';
494 err |= setvarsafe("OPTARG", s, 0);
495 c = ':';
496 }
497 else {
498 out1fmt("No arg for -%c option\n", c);
498 out2fmt_flush("No arg for -%c option\n", c);
499 INTOFF;
500 (void) unsetvar("OPTARG");
501 INTON;
502 c = '?';
503 }
504 goto bad;
505 }
506

--- 68 unchanged lines hidden ---
499 INTOFF;
500 (void) unsetvar("OPTARG");
501 INTON;
502 c = '?';
503 }
504 goto bad;
505 }
506

--- 68 unchanged lines hidden ---