unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match
@ 2019-03-06 11:27 Tobias Zawada
  2019-03-06 18:18 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tobias Zawada @ 2019-03-06 11:27 UTC (permalink / raw)
  To: 34769

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-07 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-06 11:27 bug#34769: Bug in emacs 26.1 gdb-send match-string applied after non-matching string-match Tobias Zawada
2019-03-06 18:18 ` Eli Zaretskii
2019-03-06 20:10   ` Tobias Zawada
2019-03-07 15:18     ` Eli Zaretskii

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).