Deleted Added
full compact
compile.c (16753) compile.c (17195)
1/*-
2 * Copyright (c) 1992 Diomidis Spinellis.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Diomidis Spinellis of Imperial College, University of London.
8 *

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

610}
611
612/*
613 * Compile the text following an a or i command.
614 */
615static char *
616compile_text()
617{
1/*-
2 * Copyright (c) 1992 Diomidis Spinellis.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Diomidis Spinellis of Imperial College, University of London.
8 *

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

610}
611
612/*
613 * Compile the text following an a or i command.
614 */
615static char *
616compile_text()
617{
618 int asize, size;
618 int asize, esc_nl, size;
619 char *text, *p, *op, *s;
620 char lbuf[_POSIX2_LINE_MAX + 1];
621
622 asize = 2 * _POSIX2_LINE_MAX + 1;
623 text = xmalloc(asize);
624 size = 0;
625 while (cu_fgets(lbuf, sizeof(lbuf))) {
626 op = s = text + size;
627 p = lbuf;
628 EATSPACE();
619 char *text, *p, *op, *s;
620 char lbuf[_POSIX2_LINE_MAX + 1];
621
622 asize = 2 * _POSIX2_LINE_MAX + 1;
623 text = xmalloc(asize);
624 size = 0;
625 while (cu_fgets(lbuf, sizeof(lbuf))) {
626 op = s = text + size;
627 p = lbuf;
628 EATSPACE();
629 for (; *p != '\0'; p++) {
630 if (*p == '\\')
631 *p++ = '\0';
629 for (esc_nl = 0; *p != '\0'; p++) {
630 if (*p == '\\' && p[1] != '\0' && *++p == '\n')
631 esc_nl = 1;
632 *s++ = *p;
633 }
634 size += s - op;
632 *s++ = *p;
633 }
634 size += s - op;
635 if (p[-2] != '\0') {
635 if (!esc_nl) {
636 *s = '\0';
637 break;
638 }
639 if (asize - size < _POSIX2_LINE_MAX + 1) {
640 asize *= 2;
641 text = xmalloc(asize);
642 }
643 }

--- 167 unchanged lines hidden ---
636 *s = '\0';
637 break;
638 }
639 if (asize - size < _POSIX2_LINE_MAX + 1) {
640 asize *= 2;
641 text = xmalloc(asize);
642 }
643 }

--- 167 unchanged lines hidden ---