Re: tilde-bug in vfs.c



Hi!

> > What does your patch implement?  How does it work?  Please always comment
> > non-obvious patches.  In this case we really should make a decision before
> > we go ahead and patch the code.
> 
> Oh, I thought it was so simple. :) Anyway, vfs_canon is modified to
> first canonicalize without tilde expansion. If this expanded file
> exists (according to the vfs's stat function), this name is returned.
> Otherwise, vfs_canon will simply canonicalize *with* tilde expansion
> and return the result.
> 
> To accomplish this it was necessary to create a new function
> vfs_canon_internal that can canonicalize either with tilde expansion
> or without.
> 
> The drawback is that vfs_canon in worst case takes twice as long,
> plus the time for the vfs stat call.

VFS stat can take *long*. I'd suggest against this. What about 
vfs_tilde_expand(char *name, int maxlen)?

								Pavel



-- 
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.




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