This is the mail archive of the
mailing list for the GDB project.
Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name
> Date: Mon, 15 Nov 2010 10:05:14 -0800
> From: Nathan Froyd <firstname.lastname@example.org>
> Cc: JuYoung Kim <email@example.com>, Eli Zaretskii <firstname.lastname@example.org>,
> "email@example.com" <firstname.lastname@example.org>
> + if (dirname[dir_len-1] == SLASH_STRING)
Sorry, but comparing with SLASH_STRING is as bad as comparing with
a literal '/' or '\\'. The issue here is that DOS/Windows filesystems
can use both / and \, and even mix them freely in the same file name.
IS_DIR_SEPARATOR takes this into account, while comparing against a
single character will miss the other alternative.
SLASH_STRING is for _constructing_ file names (with `concat' or
equivalent code), not for taking file names apart or examining them.