From: Jim Meyering Date: Sat, 1 May 1993 19:59:02 +0000 (+0000) Subject: merge with 1.4.1 X-Git-Tag: FILEUTILS-3_8_3b~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd3f5c47d5cc6ff344b763a24b33316d97c92a50;p=platform%2Fupstream%2Fcoreutils.git merge with 1.4.1 --- diff --git a/lib/regex.c b/lib/regex.c index 247f5f1..032b4d0 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library, - version 0.11. + version 0.12. (Implements POSIX draft P10003.2/D11.2, except for internationalization features.) @@ -127,7 +127,17 @@ init_syntax_once () /* isalpha etc. are used for the character classes. */ #include -#if !defined (isascii) || defined (STDC_HEADERS) +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining isascii to 1 should let any compiler worth its salt + eliminate the && through constant folding." */ +#if ! defined (isascii) || defined (STDC_HEADERS) #undef isascii #define isascii(c) 1 #endif @@ -1303,6 +1313,7 @@ regex_compile (pattern, size, syntax, bufp) the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') + && zero_times_ok && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ @@ -1613,6 +1624,10 @@ regex_compile (pattern, size, syntax, bufp) fixup_alt_jump = 0; laststart = 0; begalt = b; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; break; @@ -1662,6 +1677,10 @@ regex_compile (pattern, size, syntax, bufp) : 0; laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; /* We're at the end of the group, so now we know how many groups were inside this one. */ @@ -2931,7 +2950,8 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) inside the loop. */ if (translate) while (range > lim - && !fastmap[(unsigned char) translate[*d++]]) + && !fastmap[(unsigned char) + translate[(unsigned char) *d++]]) range--; else while (range > lim && !fastmap[(unsigned char) *d++]) @@ -3454,7 +3474,11 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) } } else - assert (bufp->regs_allocated == REGS_FIXED); + { + /* These braces fend off a "empty body in an else-statement" + warning under GCC when assert expands to nothing. */ + assert (bufp->regs_allocated == REGS_FIXED); + } /* Convert the pointer data in `regstart' and `regend' to indices. Register zero has to be set differently, @@ -4881,6 +4905,13 @@ regerror (errcode, preg, errbuf, errbuf_size) Dump core so we can fix it. */ abort (); + msg = re_error_msg[errcode]; + + /* POSIX doesn't require that we do anything in this case, but why + not be nice. */ + if (! msg) + msg = "Success"; + msg_size = strlen (msg) + 1; /* Includes the null. */ if (errbuf_size != 0) diff --git a/old/textutils/ChangeLog b/old/textutils/ChangeLog index de759a0..dd191a0 100644 --- a/old/textutils/ChangeLog +++ b/old/textutils/ChangeLog @@ -1,3 +1,22 @@ +Thu Apr 29 02:01:27 1993 Jim Meyering (meyering@comco.com) + + * src/*.c and man/*.c except for sort: Add --help and --version + options. + + * pr.c: Convert to use getopt_long. + + * lib/memcmp.c: Use version from glibc. + [WORDS_BIGENDIAN]: Test this instead of the using glibc's + __BYTE_ORDER macro. + * configure.in: Use AC_WORDS_BIGENDIAN to set it. + + * od.c (parse_old_offset): Allow `0X' as well as `0x' prefix to + indicate hex. + + * Makefile.in (dist): Depend on Makefile so that changes to + Makefile.in (like adding new files to DISTRIB) are reflected + in the new distribution. + Fri Apr 23 21:53:47 1993 Jim Meyering (meyering@comco.com) * {lib,src}/Makefile.in [.c.o]: Make CPPFLAGS and CFLAGS follow