Deleted Added
sdiff udiff text old ( 201951 ) new ( 201989 )
full compact
1/****************************************************************
2Copyright (C) Lucent Technologies 1997
3All Rights Reserved
4
5Permission to use, copy, modify, and distribute this software and
6its documentation for any purpose and without fee is hereby
7granted, provided that the above copyright notice appear in all
8copies and that both that the copyright notice and this

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

19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22THIS SOFTWARE.
23****************************************************************/
24
25/* lasciate ogne speranza, voi ch'intrate. */
26
27#define DEBUG
28
29#include <ctype.h>
30#include <stdio.h>
31#include <string.h>
32#include <stdlib.h>
33#include "awk.h"
34#include "ytab.h"

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

280 }
281 c = n;
282 } /* else */
283 /* c = c; */
284 *pp = p;
285 return c;
286}
287
288char *cclenter(const char *argp) /* add a character class */
289{
290 int i, c, c2;
291 uschar *p = (uschar *) argp;
292 uschar *op, *bp;
293 static uschar *buf = 0;
294 static int bufsz = 100;
295
296 op = p;
297 if (buf == 0 && (buf = (uschar *) malloc(bufsz)) == NULL)
298 FATAL("out of space for character class [%.10s...] 1", p);
299 bp = buf;
300 for (i = 0; (c = *p++) != 0; ) {
301 if (c == '\\') {
302 c = quoted((char **) &p);
303 } else if (c == '-' && i > 0 && bp[-1] != 0) {
304 if (*p != 0) {
305 c = bp[-1];
306 c2 = *p++;
307 if (c2 == '\\')
308 c2 = quoted((char **) &p);
309 if (c > c2) { /* empty; ignore */
310 bp--;
311 i--;
312 continue;
313 }
314 while (c < c2) {
315 if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1"))
316 FATAL("out of space for character class [%.10s...] 2", p);
317 *bp++ = ++c;
318 i++;
319 }
320 continue;
321 }
322 }
323 if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter2"))
324 FATAL("out of space for character class [%.10s...] 3", p);
325 *bp++ = c;

--- 629 unchanged lines hidden ---