This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]