Re: patchfs: Fixed leading ./ bug
- From: Roland Illig <roland illig gmx de>
- To: Leonard den Ottolander <leonard den ottolander nl>
- Cc: MC Devel <mc-devel gnome org>
- Subject: Re: patchfs: Fixed leading ./ bug
- Date: Sat, 23 Oct 2004 15:41:08 +0200
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]