From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Small fix in `shell--unquote&requote-argument' - please review Date: Thu, 08 Sep 2016 16:23:22 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473366043 3978 195.159.176.226 (8 Sep 2016 20:20:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 20:20:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Filipp Gunbin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 08 22:20:39 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi5oD-0007uR-5h for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 22:20:29 +0200 Original-Received: from localhost ([::1]:53904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5oA-0008A9-TG for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 16:20:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5o2-00088M-1X for emacs-devel@gnu.org; Thu, 08 Sep 2016 16:20:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi5nx-0005Zv-Rf for emacs-devel@gnu.org; Thu, 08 Sep 2016 16:20:17 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:59798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5nx-0005ZN-O6 for emacs-devel@gnu.org; Thu, 08 Sep 2016 16:20:13 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u88KKs2q025040; Thu, 8 Sep 2016 16:20:54 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4BD9D60348; Thu, 8 Sep 2016 16:23:22 -0400 (EDT) In-Reply-To: (Filipp Gunbin's message of "Thu, 08 Sep 2016 22:22:21 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5791=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5791> : inlines <5197> : streams <1697416> : uri <2284839> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207303 Archived-At: > 1. (shell--unquote&requote-argument "te'st" 2) > > This produces `("testst" 2 comint-quote-filename)'. > > Having found first `'', `string-match' cannot find closing quote. > Then (match-end 0) is used, it's value is "undefined", but happens to > be 3, so we duplicate last 2 chars and that's wrong. > > 2. (shell--unquote&requote-argument "test'" 2) > > This produces `("test" 2 comint-quote-filename)'. > > First `'' happens to be at the end of line. The condition > > `(< match (1+ (length qstr)))' OK, great, that looks very helpful. I'll take a look at the patch ASAP, Stefan