Re: patchfs: Fixed leading ./ bug

Hello Roland,

On Sat, 2004-10-23 at 15:01, Roland Illig wrote:
> >>+  $fname =~ s,/+,/,g;
> > ? Can you just remove the plus sign?
> Why do you want to replace every "/" with "/"?

That obviously is *not* what I am asking. My question is whether it is
safe to remove all plus signs from $fname (no not *all*, but all that
are preceded by a slash), not from the above expression.

> >>+  $fname =~ s,/\.$,,;
> > Why is this needed?
> Because "dir/subdir/." and "dir/subdir" are handled the same in the rest 
> of mc.

Yes, but this is about patchfs, right? The content of a diff is about
files, not directories, so this catch seems redundant. If you want this
to be a more general function for use in other shell scripts it's rather

> >>     $file=~s/^(PATCH-(CREATE|REMOVE)\/)?(.*)\.diff$/$3/;
> >>+    $file = mc_canonicalize_path ($file);
> > 
> > What happened to the ".diff$" part?
> I don't know. That has not been me.

Another misunderstanding. This is your patch right? Why don't you catch
the .diff$ part? The first expression seems to strip it from the
resulting $file, but I think you don't do that with your expression.


mount -t life -o ro /dev/dna /genetic/research

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