From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match Date: Wed, 06 Mar 2019 20:18:07 +0200 Message-ID: <835zsvdfz4.fsf@gnu.org> References: <1969119607.262870.1551871623530@email.ionos.de> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="49533"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34769@debbugs.gnu.org To: Tobias Zawada Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 19:27:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bG0-000Cnc-6m for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 19:27:08 +0100 Original-Received: from localhost ([127.0.0.1]:37416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1bFz-0007UP-2N for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 13:27:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1b8Q-0001f7-9T for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 13:19:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1b8L-0001ye-R5 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 13:19:18 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1b8A-0001v2-JW for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 13:19:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1b8A-0007iT-3J for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 13:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 18:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34769 X-GNU-PR-Package: emacs Original-Received: via spool by 34769-submit@debbugs.gnu.org id=B34769.155189630129609 (code B ref 34769); Wed, 06 Mar 2019 18:19:02 +0000 Original-Received: (at 34769) by debbugs.gnu.org; 6 Mar 2019 18:18:21 +0000 Original-Received: from localhost ([127.0.0.1]:34658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1b7U-0007hV-T4 for submit@debbugs.gnu.org; Wed, 06 Mar 2019 13:18:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1b7T-0007hI-BY for 34769@debbugs.gnu.org; Wed, 06 Mar 2019 13:18:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1b7M-0001YY-O1; Wed, 06 Mar 2019 13:18:12 -0500 Original-Received: from [176.228.60.248] (port=4079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h1b7L-0004Yg-Vb; Wed, 06 Mar 2019 13:18:12 -0500 In-reply-to: <1969119607.262870.1551871623530@email.ionos.de> (message from Tobias Zawada on Wed, 6 Mar 2019 12:27:03 +0100 (CET)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156106 Archived-At: > Date: Wed, 6 Mar 2019 12:27:03 +0100 (CET) > From: Tobias Zawada > > At the end of gdb-send one finds the following lines: > > (let* ((control-command-p (string-match gdb-control-commands-regexp string)) > (command-arg (match-string 3 string)) > > It is wrong to call (match-string 3 string) if (string-match gdb-control-commands-regexp string) returned nil. > The doc of match-string says: > "Return string of text matched by last search." > That means match-string only returns sensible results if the last match was successful. That is true, and a cleanup is a good idea. But please note that the undefined results are not used if control-command-p is nil, so the issue is not that serious. Thanks.