unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Zawada <i_inbox@tn-home.de>
To: 34769@debbugs.gnu.org
Subject: bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match
Date: Wed, 6 Mar 2019 12:27:03 +0100 (CET)	[thread overview]
Message-ID: <1969119607.262870.1551871623530@email.ionos.de> (raw)

Dear Emacs maintainers,

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.

Possible correction:

  (let* ((control-command-p (string-match gdb-control-commands-regexp string))
         (command-arg (and control-command-p (match-string 3 string)))


System info:
GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-29

Best regards,
Tobias





             reply	other threads:[~2019-03-06 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 11:27 Tobias Zawada [this message]
2019-03-06 18:18 ` bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match Eli Zaretskii
2019-03-06 20:10   ` Tobias Zawada
2019-03-07 15:18     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1969119607.262870.1551871623530@email.ionos.de \
    --to=i_inbox@tn-home.de \
    --cc=34769@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).