patchfs: Fixed leading ./ bug
Roland Illig
roland.illig at gmx.de
Sat Oct 23 13:41:08 UTC 2004
Leonard den Ottolander wrote:
> 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.
The + sign matches 1 or more slashes. A literal + would have been \+.
> 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
> incomplete.
accepted.
>>>> $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.
I just added the mc_canonicalize_path line. The first line is still
active after the patch.
Roland
More information about the mc-devel
mailing list