Re: Retain orig. filename as suffix for tmp. filename



On Mon, Feb 24, 2003 at 02:26:13AM +0100, Oswald Buddenhagen wrote:
> > +    if (basename && *basename==PATH_SEP)
> > +	basename++;
> this is totally bogus.

No, this is not 'totally bogus'. Filename var always contains at least
one PATH_SEP:

cdbackup-0.6.3.tar.gz#utar/cdbackup-0.6.3/CHANGES
/#ftp:portal aaaa pl/backup

So this 'if' is just to protect from the impossible. As all
programmers know impossible happens about once a year to (and I want
to be protected just in case some code changes etc.), and we surely
dont want to increment NULL of increment beyond the string. Result is
not so important in impossible case :)

Of course your code would be also good, with one exception:

  basename = filename;

because filename includes all the vfs stuff, which we don't want IMO.

Regards

-- 

  _.|._ |_  _.   :  Adam Byrtek /alpha/
 (_|||_)| |(_|   :  email  alpha@(irc.pl|debian.org)
     |           :  jabber alpha.pl(at)jabber.org, pgp 0xB25952C0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]