X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c547693afdacf4b865027d3bb8c53f601eadb5ae..6dc4663d5c0bd4a2a8c964d9ebfb2f074bb5bc4f:/src/files.c diff --git a/src/files.c b/src/files.c index 550e42ed..91c0c10e 100644 --- a/src/files.c +++ b/src/files.c @@ -134,6 +134,15 @@ xfclose (FILE *ptr) } +FILE * +xfdopen (int fd, char const *mode) +{ + FILE *res = fdopen (fd, mode); + if (! res) + error (EXIT_FAILURE, get_errno (), "fdopen"); + return res; +} + /*------------------------------------------------------------------. | Compute ALL_BUT_EXT, ALL_BUT_TAB_EXT and output files extensions. | `------------------------------------------------------------------*/ @@ -207,7 +216,7 @@ file_name_split (const char *file_name, *base = last_component (file_name); /* Look for the extension, i.e., look for the last dot. */ - *ext = mbsrchr (*base, '.'); + *ext = strrchr (*base, '.'); *tab = NULL; /* If there is an extension, check if there is a `.tab' part right