maint: don't use mbsr?chr.

Basically, revert ba60c39547a445dee3e07920931b4d7a81843868's move to
mbs* functions, which was prompted by -DGNULIB_POSIXCHECK.  See
<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00052.html>
and following.

* bootstrap.conf: No longer ask for them.
* src/files.c, src/getargs.c, src/location.c,
* src/parse-gram.c, src/parse-gram.y, src/scan-gram.l,
* src/symtab.c: s/mbs(r?chr)/str$1/g.
This commit is contained in:
Akim Demaille
2012-06-05 17:46:58 +02:00
parent d9a7c07c5a
commit 84526bf3d1
9 changed files with 10 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ gnulib_modules='
error extensions fdl fopen-safer gendocs getopt-gnu error extensions fdl fopen-safer gendocs getopt-gnu
gettext git-version-gen gitlog-to-changelog gettext git-version-gen gitlog-to-changelog
gpl-3.0 hash inttypes isnan javacomp-script gpl-3.0 hash inttypes isnan javacomp-script
javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr javaexec-script ldexpl maintainer-makefile malloc-gnu
mbswidth obstack perror progname mbswidth obstack perror progname
quote quotearg quote quotearg
readme-release readme-release

2
lib/.gitignore vendored
View File

@@ -109,9 +109,7 @@
/mbchar.c /mbchar.c
/mbchar.h /mbchar.h
/mbrtowc.c /mbrtowc.c
/mbschr.c
/mbsinit.c /mbsinit.c
/mbsrchr.c
/mbswidth.c /mbswidth.c
/mbswidth.h /mbswidth.h
/mbuiter.h /mbuiter.h

View File

@@ -207,7 +207,7 @@ file_name_split (const char *file_name,
*base = last_component (file_name); *base = last_component (file_name);
/* Look for the extension, i.e., look for the last dot. */ /* Look for the extension, i.e., look for the last dot. */
*ext = mbsrchr (*base, '.'); *ext = strrchr (*base, '.');
*tab = NULL; *tab = NULL;
/* If there is an extension, check if there is a `.tab' part right /* If there is an extension, check if there is a `.tab' part right

View File

@@ -559,7 +559,7 @@ getargs (int argc, char *argv[])
case 'F': /* -FNAME[=VALUE]. */ case 'F': /* -FNAME[=VALUE]. */
{ {
char* name = optarg; char* name = optarg;
char* value = mbschr (optarg, '='); char* value = strchr (optarg, '=');
if (value) if (value)
*value++ = 0; *value++ = 0;
muscle_percent_define_insert (name, command_line_location (), muscle_percent_define_insert (name, command_line_location (),

View File

@@ -143,11 +143,11 @@ boundary_set_from_string (boundary *bound, char *loc_str)
{ {
/* Must search in reverse since the file name field may /* Must search in reverse since the file name field may
* contain `.' or `:'. */ * contain `.' or `:'. */
char *delim = mbsrchr (loc_str, '.'); char *delim = strrchr (loc_str, '.');
aver (delim); aver (delim);
*delim = '\0'; *delim = '\0';
bound->column = atoi (delim+1); bound->column = atoi (delim+1);
delim = mbsrchr (loc_str, ':'); delim = strrchr (loc_str, ':');
aver (delim); aver (delim);
*delim = '\0'; *delim = '\0';
bound->line = atoi (delim+1); bound->line = atoi (delim+1);

View File

@@ -2431,7 +2431,7 @@ yyreduce:
#line 343 "src/parse-gram.y" #line 343 "src/parse-gram.y"
{ {
char const *skeleton_user = (yyvsp[0].chars); char const *skeleton_user = (yyvsp[0].chars);
if (mbschr (skeleton_user, '/')) if (strchr (skeleton_user, '/'))
{ {
size_t dir_length = strlen (current_file); size_t dir_length = strlen (current_file);
char *skeleton_build; char *skeleton_build;

View File

@@ -342,7 +342,7 @@ prologue_declaration:
| "%skeleton" STRING | "%skeleton" STRING
{ {
char const *skeleton_user = $2; char const *skeleton_user = $2;
if (mbschr (skeleton_user, '/')) if (strchr (skeleton_user, '/'))
{ {
size_t dir_length = strlen (current_file); size_t dir_length = strlen (current_file);
char *skeleton_build; char *skeleton_build;

View File

@@ -941,8 +941,8 @@ handle_syncline (char *args, location loc)
{ {
char *after_num; char *after_num;
unsigned long int lineno = strtoul (args, &after_num, 10); unsigned long int lineno = strtoul (args, &after_num, 10);
char *file = mbschr (after_num, '"') + 1; char *file = strchr (after_num, '"') + 1;
*mbschr (file, '"') = '\0'; *strchr (file, '"') = '\0';
if (INT_MAX <= lineno) if (INT_MAX <= lineno)
{ {
warn_at (loc, _("line number overflow")); warn_at (loc, _("line number overflow"));

View File

@@ -67,7 +67,7 @@ symbol_new (uniqstr tag, location loc)
/* If the tag is not a string (starts with a double quote), check /* If the tag is not a string (starts with a double quote), check
that it is valid for Yacc. */ that it is valid for Yacc. */
if (tag[0] != '\"' && tag[0] != '\'' && mbschr (tag, '-')) if (tag[0] != '\"' && tag[0] != '\'' && strchr (tag, '-'))
yacc_at (loc, _("POSIX Yacc forbids dashes in symbol names: %s"), yacc_at (loc, _("POSIX Yacc forbids dashes in symbol names: %s"),
tag); tag);