[patch]change dwarf2_start_subfile() to adapt inappropriate dir name

Eli Zaretskii eliz@gnu.org
Mon Nov 15 18:34:00 GMT 2010


> Date: Mon, 15 Nov 2010 10:05:14 -0800
> From: Nathan Froyd <froydnj@codesourcery.com>
> Cc: JuYoung Kim <j0.kim@samsung.com>, Eli Zaretskii <eliz@gnu.org>,
> 	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> 
> +      if (dirname[dir_len-1] == SLASH_STRING[0])

Sorry, but comparing with SLASH_STRING[0] 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.



More information about the Gdb-patches mailing list