Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 18 Mar 2013 21:18:30 -0400
From:  <jfoug@....net>
To: john-dev@...ts.openwall.com
Cc: magnum <john.magnum@...hmail.com>
Subject: Re: basename portability 'fix'.

---- magnum <john.magnum@...hmail.com> wrote: 
> Parts of your patch has CRLF and parts of it does not. This made git disregard most of it as "whitespace errors" :-)  Also, I get this:
> 
> misc.c: In function 'jtr_basename_r':
> misc.c:199:19: warning: variable 'name' set but not used [-Wunused-but-set-variable]
> misc.c: In function 'jtr_basename_r':
> misc.c:199:19: warning: variable 'name' set but not used [-Wunused-but-set-variable]
> 
> I guess we can just drop all statements that declare or set name?

Yes, I believe so.  I originally used it, before adding the "if (p[1] && !SEP_CHAR(p[1]))" code within the while statement.  It was used walk backwards, since the base pointer would walk off the end of the string in cases like:

/usr/local/   Now, base will be 'local/' since I do not walk the base pointer, until there is something 'useful' past the current part.

So, yes, we can drop the var, and it's initialization, it is not needed any more.  Also, the param _name can simply be changed to name like Lukas mentioned.

Jim.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.