Deleted Added
full compact
parser.c (286973) parser.c (287081)
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[] = "@(#)parser.c 8.7 (Berkeley) 5/16/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[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/parser.c 286973 2015-08-20 22:05:55Z jilles $");
39__FBSDID("$FreeBSD: head/bin/sh/parser.c 287081 2015-08-23 20:44:53Z jilles $");
40
41#include <stdlib.h>
42#include <unistd.h>
43#include <stdio.h>
44
45#include "shell.h"
46#include "parser.h"
47#include "nodes.h"

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

1657 }
1658 USTPUTC(c1, out);
1659 } else {
1660 subtype = VSERROR;
1661 if (c == '}')
1662 pungetc();
1663 else if (c == '\n' || c == PEOF)
1664 synerror("Unexpected end of line in substitution");
40
41#include <stdlib.h>
42#include <unistd.h>
43#include <stdio.h>
44
45#include "shell.h"
46#include "parser.h"
47#include "nodes.h"

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

1657 }
1658 USTPUTC(c1, out);
1659 } else {
1660 subtype = VSERROR;
1661 if (c == '}')
1662 pungetc();
1663 else if (c == '\n' || c == PEOF)
1664 synerror("Unexpected end of line in substitution");
1665 else
1665 else if (BASESYNTAX[c] != CCTL)
1666 USTPUTC(c, out);
1667 }
1668 if (subtype == 0) {
1669 switch (c) {
1670 case ':':
1671 flags |= VSNUL;
1672 c = pgetc_linecont();
1673 /*FALLTHROUGH*/
1674 default:
1675 p = strchr(types, c);
1676 if (p == NULL) {
1677 if (c == '\n' || c == PEOF)
1678 synerror("Unexpected end of line in substitution");
1679 if (flags == VSNUL)
1680 STPUTC(':', out);
1666 USTPUTC(c, out);
1667 }
1668 if (subtype == 0) {
1669 switch (c) {
1670 case ':':
1671 flags |= VSNUL;
1672 c = pgetc_linecont();
1673 /*FALLTHROUGH*/
1674 default:
1675 p = strchr(types, c);
1676 if (p == NULL) {
1677 if (c == '\n' || c == PEOF)
1678 synerror("Unexpected end of line in substitution");
1679 if (flags == VSNUL)
1680 STPUTC(':', out);
1681 STPUTC(c, out);
1681 if (BASESYNTAX[c] != CCTL)
1682 STPUTC(c, out);
1682 subtype = VSERROR;
1683 } else
1684 subtype = p - types + VSNORMAL;
1685 break;
1686 case '%':
1687 case '#':
1688 {
1689 int cc = c;

--- 384 unchanged lines hidden ---
1683 subtype = VSERROR;
1684 } else
1685 subtype = p - types + VSNORMAL;
1686 break;
1687 case '%':
1688 case '#':
1689 {
1690 int cc = c;

--- 384 unchanged lines hidden ---