Subject: Re: bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 16 Jul 2021 15:50:41 +0200

Michael Albinus <[email-masked]> writes:

> diff-hunk-file-names reads file names from the *Diff* buffer. The first
> line (the diff command itself) can contain labels, marked with -L. If
> these labels contains quoted characters like in remote file names, the
> quotation is returned. Example:
>
> diff -c -L /ftp\:slbhao\:/home/albinus/src/tramp/lisp/tramp.el -L /ftp\:slbhao\:/home/albinus/src/emacs/lisp/net/tramp.el /tmp/ange-ftp13518wvE.el /tmp/ange-ftp1351895K.el

Looking at the code, it just returns the first two "words" after
"diff -OPTION":

             ;; this assumes that there are no spaces in filenames
	     (when (re-search-backward
		    "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?"
		    nil t)
	       (list (if old (match-string 2) (match-string 4))
		     (if old (match-string 4) (match-string 2)))))))))

I guess we could filter out "-L +\\S-+" before matching?  But I don't
think I've ever seen "-L" in the wild, so I don't know whether it's
worth doing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no