GNU bug report logs - #61326
30.0.50; Editing fil in zip file without extension save creates new file

Previous Next

Package: emacs;

Reported by: Adam Sjøgren <asjo <at> koldfront.dk>

Date: Mon, 6 Feb 2023 17:01:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: 61326 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, asjo <at> koldfront.dk
Subject: bug#61326: [DRAFT PATCH] Work around zip's filename extension limitation (was: Adding --no-add-suffix to zip patch)
Date: Thu, 09 Feb 2023 00:48:15 +0800
[Message part 1 (text/plain, inline)]
Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Cc: 61326 <at> debbugs.gnu.org
>>> Date: Tue, 7 Feb 2023 09:31:11 +0800
>>> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>>
>>> Maybe, at least in the meantime, we change it such that all write operations
>>> for zip create files in temp, and move to / overwrite the original file when
>>> done? Although I don’t have a full understanding on how that would be done and
>>> whether there are problems along with it.
>>
>> How about submitting a patch to do that, but only when the original
>> file doesn't have an extension?
>
> Will do.  Will report back in 2-3 days unless someone else gets to it
> first.
>
> Best,
>
>
> RY

Here is a preliminary patch that contains some "REVIEW" comments where I
need inputs.  I have tested with the following recipe and things seem to
work correctly:

$ touch 1 2 && zip z 1 2 && mv z.zip z
$ ls -l
.... 1
.... 2
.... z
$ src/emacs -Q
RET          ; open file "1" from within "z" archive
s C-x C-s    ; insert "s" and save file "1"
C-x C-c      ; exit
$ ls -l      # notice that no "z.zip" exists, and "z" is correctly updated
.... 1
.... 2
.... z

Patch based on 907fd1f7ff402f9d226ebb3b891ea5b54fac1d1c which is ~3 days
old.  I will amend the commit (and rebase if necessary) according to ML
reviews and further progress.

[0001-lisp-arc-mode.el-Work-around-zip-s-filename-limitati.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Best,


RY

This bug report was last modified 2 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.