> From: Pedro Alves <[email protected]> > Date: Tue, 8 Mar 2011 22:37:59 +0000 > Cc: DJ Delorie <[email protected]>, > Eli Zaretskii <[email protected]>, > [email protected], > [email protected], > [email protected] > > Actually, is there any case where lbasename wouldn't > work instead of filename_dirrchr?
Almost: lbasename returns a pointer one character _after_ the last slash. It also skips the drive letter on DOS/Windows (which might be TRT, actually). It would be reasonable to rewrite filename_dirrchr in terms of lbasename, though, by backing up the pointer returned by lbasename if it points to a slash, and otherwise returning NULL. The case of "d:foo" should also be resolved (probably, return a pointer to the colon).
