* bootstrap.conf (gnulib_modules): Add all modules suggested by
-DGNULIB_POSIXCHECK.
* src/files.c (file_name_split)
* src/getargs.c (getargs)
* src/location.c (boundary_set_from_string)
* src/output.c (output_skeleton)
* src/parse-gram.y (prologue_declaration)
* src/scan-gram.l (handle_syncline)
* src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of
strchr and strrchr. In the cases of command-line options, file
names, and thus locations, functionality may be improved. In the
case of symbol names, there should be no functional difference as
all characters are ASCII, so the intended benefit is just warning
suppression.
(cherry picked from commit
d143e9c33f07e1a9966c10077f43e2f81232bf6c)
Conflicts:
src/output.c
src/parse-gram.c
src/parse-gram.h
+2011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
+
+ Pacify -DGNULIB_POSIXCHECK.
+ * bootstrap.conf (gnulib_modules): Add all modules suggested by
+ -DGNULIB_POSIXCHECK.
+ * src/files.c (file_name_split)
+ * src/getargs.c (getargs)
+ * src/location.c (boundary_set_from_string)
+ * src/output.c (output_skeleton)
+ * src/parse-gram.y (prologue_declaration)
+ * src/scan-gram.l (handle_syncline)
+ * src/symtab.c (symbol_new): Use mbschr and mbsrchr instead of
+ strchr and strrchr. In the cases of command-line options, file
+ names, and thus locations, functionality may be improved. In the
+ case of symbol names, there should be no functional difference as
+ all characters are ASCII, so the intended benefit is just warning
+ suppression.
+
2011-05-01 Joel E. Denny <joeldenny@joeldenny.org>
* NEWS (2.5): Fix minor typos.
# gnulib modules used by this package.
gnulib_modules='
- announce-gen argmatch assert config-h c-strcase configmake dirname
- error extensions fopen-safer gendocs getopt-gnu gettext
- git-version-gen hash inttypes javacomp-script javaexec-script
- maintainer-makefile malloc-gnu mbswidth obstack quote quotearg
- realloc-posix spawn-pipe stdbool stpcpy strerror strtoul strverscmp unistd
- unistd-safer unlocked-io update-copyright unsetenv verify warnings
- xalloc xalloc-die xstrndup
+ announce-gen argmatch assert calloc-posix close config-h c-strcase
+ configmake dirname error extensions fopen-safer gendocs getopt-gnu
+ gettext git-version-gen hash inttypes isnan javacomp-script
+ javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
+ mbswidth obstack perror pipe-posix quote quotearg realloc-posix
+ spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
+ unistd unistd-safer unlocked-io update-copyright unsetenv verify
+ warnings xalloc xalloc-die xstrndup
fprintf-posix printf-posix snprintf-posix sprintf-posix
vsnprintf-posix vsprintf-posix
/c-strcase.h
/c-strcasecmp.c
/c-strncasecmp.c
+/calloc.c
/charset.alias
/cloexec.c
/cloexec.h
+/close-hook.c
+/close-hook.h
+/close.c
/config.charset
/config.h
/config.hin
/exitfail.h
/fatal-signal.c
/fatal-signal.h
+/fclose.c
/fcntl.c
/fcntl.h
/fcntl.in.h
/isnanf.c
/isnanl-nolibm.h
/isnanl.c
+/iswblank.c
+/ldexpl.c
/localcharset.c
/localcharset.h
/malloc.c
/math.h
/math.in.h
+/mbchar.c
+/mbchar.h
/mbrtowc.c
+/mbschr.c
/mbsinit.c
+/mbsrchr.c
/mbswidth.c
/mbswidth.h
+/mbuiter.h
/memchr.c
/memchr.valgrind
/nonblocking.c
/obstack.c
/obstack.h
/open.c
+/perror.c
/pipe-safer.c
+/pipe.c
/pipe2-safer.c
/pipe2.c
/printf-args.c
/stpcpy.c
/strchrnul.c
/strchrnul.valgrind
+/strdup.c
/streq.h
/strerror.c
/string.h
/stripslash.c
/strndup.c
/strnlen.c
+/strnlen1.c
+/strnlen1.h
/strtol.c
/strtoul.c
/strverscmp.c
/argmatch.m4
/asm-underscore.m4
/assert.m4
+/calloc.m4
/cloexec.m4
+/close.m4
/codeset.m4
/config-h.m4
/configmake.m4
/exponentl.m4
/extensions.m4
/fatal-signal.m4
+/fclose.m4
/fcntl-o.m4
/fcntl.m4
/fcntl_h.m4
/inttypes.m4
/inttypes_h.m4
/ioctl.m4
+/isnan.m4
/isnand.m4
/isnanf.m4
/isnanl.m4
+/iswblank.m4
/javacomp.m4
/javaexec.m4
/ldexpl.m4
/longlong.m4
/malloc.m4
/math_h.m4
+/mbchar.m4
+/mbiter.m4
/mbrtowc.m4
/mbsinit.m4
/mbstate_t.m4
/nls.m4
/nocrash.m4
/open.m4
+/perror.m4
+/pipe.m4
/pipe2.m4
/po.m4
/posix_spawn.m4
/stdlib_h.m4
/stpcpy.m4
/strchrnul.m4
+/strdup.m4
/strerror.m4
/string_h.m4
/strndup.m4
*base = last_component (file_name);
/* Look for the extension, i.e., look for the last dot. */
- *ext = strrchr (*base, '.');
+ *ext = mbsrchr (*base, '.');
*tab = NULL;
/* If there is an extension, check if there is a `.tab' part right
case 'F': /* -FNAME[=VALUE]. */
{
char* name = optarg;
- char* value = strchr (optarg, '=');
+ char* value = mbschr (optarg, '=');
if (value)
*value++ = 0;
muscle_percent_define_insert (name, command_line_location (),
{
/* Must search in reverse since the file name field may
* contain `.' or `:'. */
- char *delim = strrchr (loc_str, '.');
+ char *delim = mbsrchr (loc_str, '.');
aver (delim);
*delim = '\0';
bound->column = atoi (delim+1);
- delim = strrchr (loc_str, ':');
+ delim = mbsrchr (loc_str, ':');
aver (delim);
*delim = '\0';
bound->line = atoi (delim+1);
full_m4sugar = xstrdup (full_skeleton);
strcpy (full_skeleton + pkgdatadirlen + 1, m4bison);
full_m4bison = xstrdup (full_skeleton);
- if (strchr (skeleton, '/'))
+ if (mbschr (skeleton, '/'))
strcpy (full_skeleton, skeleton);
else
strcpy (full_skeleton + pkgdatadirlen + 1, skeleton);
#line 342 "src/parse-gram.y"
{
char const *skeleton_user = (yyvsp[0].chars);
- if (strchr (skeleton_user, '/'))
+ if (mbschr (skeleton_user, '/'))
{
size_t dir_length = strlen (current_file);
char *skeleton_build;
| "%skeleton" STRING
{
char const *skeleton_user = $2;
- if (strchr (skeleton_user, '/'))
+ if (mbschr (skeleton_user, '/'))
{
size_t dir_length = strlen (current_file);
char *skeleton_build;
{
char *after_num;
unsigned long int lineno = strtoul (args, &after_num, 10);
- char *file = strchr (after_num, '"') + 1;
- *strchr (file, '"') = '\0';
+ char *file = mbschr (after_num, '"') + 1;
+ *mbschr (file, '"') = '\0';
if (INT_MAX <= lineno)
{
warn_at (loc, _("line number overflow"));
/* If the tag is not a string (starts with a double quote), check
that it is valid for Yacc. */
- if (tag[0] != '\"' && tag[0] != '\'' && strchr (tag, '-'))
+ if (tag[0] != '\"' && tag[0] != '\'' && mbschr (tag, '-'))
yacc_at (loc, _("POSIX Yacc forbids dashes in symbol names: %s"),
tag);