=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/awk/lex.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/awk/lex.c 2004/12/30 01:52:48 1.8 --- src/usr.bin/awk/lex.c 2006/04/16 02:10:18 1.9 *************** *** 1,4 **** ! /* $OpenBSD: lex.c,v 1.8 2004/12/30 01:52:48 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved --- 1,4 ---- ! /* $OpenBSD: lex.c,v 1.9 2006/04/16 02:10:18 hugh Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved *************** *** 514,520 **** int regexpr(void) { ! int c; static char *buf = 0; static int bufsz = 500; char *bp; --- 514,520 ---- int regexpr(void) { ! int c, openclass = 0; static char *buf = 0; static int bufsz = 500; char *bp; *************** *** 522,528 **** if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for rex expr"); bp = buf; ! for ( ; (c = input()) != '/' && c != 0; ) { if (!adjbuf(&buf, &bufsz, bp-buf+3, 500, &bp, 0)) FATAL("out of space for reg expr %.10s...", buf); if (c == '\n') { --- 522,528 ---- if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) FATAL("out of space for rex expr"); bp = buf; ! for ( ; ((c = input()) != '/' || openclass == 1) && c != 0; ) { if (!adjbuf(&buf, &bufsz, bp-buf+3, 500, &bp, 0)) FATAL("out of space for reg expr %.10s...", buf); if (c == '\n') { *************** *** 533,538 **** --- 533,542 ---- *bp++ = '\\'; *bp++ = input(); } else { + if (c == '[') + openclass = 1; + else if (c == ']') + openclass = 0; *bp++ = c; } }