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: Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name


Thanks for your kind comment.

I changed the source code as below :

........
  if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL) 
    {
      if (IS_DIR_SEPARATOR(dirname[strlen (dirname) - 1]))
        fullname = concat (dirname, filename, (char *)NULL);
      else 
        fullname = concat (dirname, SLASH_STRING, filename, (char *)NULL);
    }
  else
    fullname = filename;
..........

I hope this code is proper to the standard, and no more to be fixed.
Please, tell me what is the next step that I should do for applying to the real source code.

Thanks.

------- Original Message -------
Sender : Eli Zaretskii<eliz@gnu.org>
Date : 2010-11-15 13:08 (GMT+09:00)
Title : Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name
Â
> Date: Mon, 15 Nov 2010 01:21:14 +0000 (GMT)
> From: JuYoung Kim 
> Cc: êìì 
> 
> ÂÂif (!IS_ABSOLUTE_PATH (filename) && dirname != NULL) {
> ÂÂ Â if (dirname[strlen(dirname)-1] == '/' || dirname[strlen(dirname)-1] == '')

Please use IS_DIR_SEPARATOR instead of testing for '/' literally.ÂÂAnd
the second part of the if clause cannot happen at all, so it should be
removed.

Also, the GNU coding standards say to put the braces like this:

ÂÂ if (something)
ÂÂÂÂ{
ÂÂÂÂÂÂdo_something;
ÂÂÂÂÂÂdo_something_else;
ÂÂÂÂ}

> ÂÂ Â else fullname = concat (dirname, SLASH_STRING, filename, (char *)NULL);

Make "else" have its own line, like this:

ÂÂ else
ÂÂÂÂ fullname = concat (dirname, SLASH_STRING, filename, NULL);

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