Thanks. On Tuesday 15 March 2011 07:25:10, Kai Tietz wrote: > @@ -989,6 +989,13 @@ handle_toplevel_file (directive_handler_ > > in_fname = read_md_filename; > lastsl = strrchr (in_fname, '/'); > +#ifdef HAVE_DOS_BASED_FILE_SYSTEM > + { > + char *lsl2 = strrchr (in_fname, '\\'); > + if (!lastsl || (lsl2 && lsl2 > lastsl)) > + lastsl = lsl2; > + } > +#endif > if (lastsl != NULL) > base_dir = xstrndup (in_fname, lastsl - in_fname + 1); > else
This looks like lbasename-able as well, getting rid of that HAVE_DOS...-ish foo: base = lbasename (in_fname); if (base == in_fname) base_dir = NULL; else base_dir = xstrndup (in_fname, base - in_fname); -- Pedro Alves