Ticket #3851 (new defect)

Opened 7 years ago

Last modified 7 years ago

update patch extfs for diffutils 3.3 change

Reported by: mnk Owned by:
Priority: minor Milestone: Future Releases
Component: mc-vfs Version: 4.8.19
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

It seem this somewhat corner case was missed a few years ago.

The NEWS snippet:

A file name containing spaces, double quotes, backslashes or control
characters is now encoded in a diff header as a double-quoted C string
literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v and
\ooo (a three-digit octal number between 0 and 255) are used.

So, this case isn't covered by patchfs.in, resulting sometimes in a non-working vfs getting created.

Change History

comment:1 Changed 7 years ago by andrew_b

  • Component changed from mc-core to mc-vfs

comment:2 Changed 7 years ago by mnk

I don't know perl, following is just a result of googling.

It seems that putting following in patchfs_canonicalize_path makes things somewhat working (meaning they aren't broken in an obvious way, though can't say what happens for names actually starting with '"' or containing backslashes...though if I'm reading the snippet correctly, that shouldn't happen):

  $fname =~ s,^"(.*)"$,$1,;
  $fname =~ s[\\(?:([0-7]{1,3})|(.))] [defined($1) ? chr(oct($1)) : $2]eg;
Note: See TracTickets for help on using tickets.