-#ifdef MSDOS
- strlwr (spec_outfile);
-#endif /* MSDOS */
- /* BASE_LENGTH includes ".tab" but not ".c". */
- base_length = strlen (spec_outfile);
-
- ext_index = get_extension_index (spec_outfile);
- /* if the initial segment of extension contains 'c' or a 'C', I assume
- that it is a C or C++ source file */
- if (ext_index)
- ext_index = (strspn(spec_outfile + ext_index + 1, "cC")) ? ext_index : 0;
- if (ext_index)
- {
- base_length -= strlen (spec_outfile + ext_index);
- compute_exts_from_src(spec_outfile + ext_index);
- }
-
- base_name = strndup (spec_outfile, base_length);
- /* SHORT_BASE_LENGTH includes neither ".tab" nor ".c". */
- short_base_length = base_length;
- if (strsuffix (base_name, ".tab") || strsuffix (base_name, "_tab"))
- short_base_length -= 4;
- short_base_name = strndup (spec_outfile, short_base_length);
-
- return;
+ file_name_split (spec_outfile, &base, &tab, &ext);
+ dir_prefix = xstrndup (spec_outfile, base - spec_outfile);
+
+ /* ALL_BUT_EXT goes up the EXT, excluding it. */
+ all_but_ext =
+ xstrndup (spec_outfile,
+ (strlen (spec_outfile) - (ext ? strlen (ext) : 0)));
+
+ /* ALL_BUT_TAB_EXT goes up to TAB, excluding it. */
+ all_but_tab_ext =
+ xstrndup (spec_outfile,
+ (strlen (spec_outfile)
+ - (tab ? strlen (tab) : (ext ? strlen (ext) : 0))));
+
+ if (ext)
+ compute_exts_from_src (ext);