-#ifdef MSDOS
- if (!noparserflag)
- actfile = mktemp (stringappend (tmp_base, tmp_len, "acXXXXXX"));
- tmpattrsfile = mktemp (stringappend (tmp_base, tmp_len, "atXXXXXX"));
- tmptabfile = mktemp (stringappend (tmp_base, tmp_len, "taXXXXXX"));
- tmpdefsfile = mktemp (stringappend (tmp_base, tmp_len, "deXXXXXX"));
-#else
- if (!noparserflag)
- actfile = mktemp (stringappend (tmp_base, tmp_len, "act.XXXXXX"));
- tmpattrsfile = mktemp (stringappend (tmp_base, tmp_len, "attrs.XXXXXX"));
- tmptabfile = mktemp (stringappend (tmp_base, tmp_len, "tab.XXXXXX"));
- tmpdefsfile = mktemp (stringappend (tmp_base, tmp_len, "defs.XXXXXX"));
-#endif /* not MSDOS */
-
- if (!noparserflag)
- faction = xfopen (actfile, "w+");
- fattrs = xfopen (tmpattrsfile, "w+");
- ftable = xfopen (tmptabfile, "w+");
-
- if (definesflag)
+ 'foo.tab' -> *BASE = 'foo.tab', *TAB = NULL, *EXT = '.tab'
+
+ 'foo_tab' -> *BASE = 'foo_tab', *TAB = NULL, *EXT = NULL
+
+ 'foo' -> *BASE = 'foo', *TAB = NULL, *EXT = NULL. */
+
+static void
+file_name_split (const char *file_name,
+ const char **base, const char **tab, const char **ext)
+{
+ *base = last_component (file_name);
+
+ /* Look for the extension, i.e., look for the last dot. */
+ *ext = strrchr (*base, '.');
+ *tab = NULL;
+
+ /* If there is an extension, check if there is a `.tab' part right
+ before. */
+ if (*ext)