Subject: bug#22168: 23.2; regexp p4-pathname-with-revision-plus- incorrectly matches multiple lines

From: Larry Smith <[email-masked]>
Date: Mon, 14 Dec 2015 12:28:07 -0500

I did M-x p4-ediff, and it errored out with the message 
  p4-map-depot-files: Pathname in FILE-LIST exceeds p4-command-line-length

I traced it back to the regexp 

(defconst p4-pathname-with-revision-plus-
  "\\(^\\)\\(//[^/@# ][^/@#]*/[^@#]+\\)#[0-9]+ - ")

which incorrectly matches across multiple lines. Each  [^...] should include newlines, e.g.
  "\\(^\\)\\(//[^/@# \n][^/@#\n]*/[^@#\n]+\\)#[0-9]+ - ")

It just happened that it matched 700 lines of my source file.

I see other regexps in p4.el with the same (potential) problem. If nothing else, it could cause performance problems!

Regards,
Larry

In GNU Emacs 23.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2010-09-29 on adcvbuild-el5-64
Windowing system distributor `The X.Org Foundation', version 11.0.60900000
configured using `configure  '--prefix=/tool/pandora64/.package/emacs-23.2' '--with-gif=no' '--x-libraries=/usr/lib64' '--x-includes=/usr/include' '--with-xft''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
<down-mouse-4> <mouse-4> <double-down-mouse-4> <double-mouse-4> 
<triple-down-mouse-4> <triple-mouse-4> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-4> <mouse-4> <help-echo> <down-mouse-1> 
<mouse-1> <escape> > <help-echo> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> M-p <return> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-movement> <drag-mouse-1> 
M-w <down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> 
C-r <return> C-y <return> C-r C-r C-r C-x o C-r C-r 
C-r <escape> > <help-echo> <down-mouse-1> <mouse-1> 
<escape> > <help-echo> <down-mouse-1> <mouse-1> C-s 
C-w C-w C-w C-w C-w C-x o C-r C-r C-r <escape> 0 C-l 
<down-mouse-1> <mouse-1> <escape> C-. C-g <escape> 
> <switch-frame> <down-mouse-1> <mouse-movement> <mouse-1> 
C-x C-b C-g <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> C-x C-b C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-g C-g <help-echo> <down-mouse-1> 
<mouse-movement> <mouse-1> C-x C-b C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-g C-g C-x b b c <tab> C-g C-x 
b p c <backspace> <backspace> b <tab> C-g C-g C-x C-f 
v e r o <backspace> i f / c o r e / m <tab> i <tab> 
b c _ i n t f <tab> u <tab> <return> M-x p 4 - e d 
i f f <return> q M-x b d g <return> <backspace> <backspace> 
<backspace> d b g <return> M-x p 4 - e d i f f <return> 
<help-echo> <help-echo> <down-mouse-1> <mouse-2> <help-echo> 
<help-echo> <down-mouse-5> <mouse-5> <help-echo> <help-echo> 
<down-mouse-1> <mouse-2> <help-echo> <down-mouse-1> 
<mouse-2> <help-echo> <help-echo> <down-mouse-5> <mouse-5> 
<down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> <down-mouse-5> 
<mouse-5> <down-mouse-4> <mouse-4> <down-mouse-1> <mouse-movement> 
<mouse-movement> <drag-mouse-1> M-w <left> <left> C-h 
v <return> <help-echo> <help-echo> <down-mouse-1> <mouse-2> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <menu-bar> <help-menu> <send-emacs-bug
-report>

Recent messages:
    BitmaptakenHit[rtuline_trans.tid] = 1;
  end   

  //This is legacy XV code: fix for bug "
Buffer is read-only: #<buffer bc_intf_util.sv>
set debug-on-error to t
Fontifying bc_intf_util.sv#175... (syntactically...)
Entering debugger...
Note: file is write protected
Type C-x 4 C-o RET to restore the other window.

Load-path shadows:
/home/lsmith/Gnu/Lib-common/make-regexp hides /tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/make-regexp
/home/lsmith/Gnu/Lib-common/tex-mode hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/textmodes/tex-mode
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/verilog-mode hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/progmodes/verilog-mode
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/cperl-mode hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/progmodes/cperl-mode
/home/lsmith/Gnu/ruby-mode/ruby-mode hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/progmodes/ruby-mode
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-mode hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-mode
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-units hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-units
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-cplx hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-cplx
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-incom hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-incom
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-comb hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-comb
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-forms hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-forms
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-alg hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-alg
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-stuff hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-stuff
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-fin hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-fin
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-trail hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-trail
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-yank hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-yank
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-embed hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-embed
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-frac hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-frac
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-funcs hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-funcs
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-lang hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-lang
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-aent hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-aent
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-help hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-help
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-misc hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-misc
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-ext hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-ext
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-vec hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-vec
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-rules hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-rules
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-sel hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-sel
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-arith hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-arith
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-poly hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-poly
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-undo hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-undo
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-prog hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-prog
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-keypd hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-keypd
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-math hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-math
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-bin hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-bin
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-store hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-store
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-graph hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-graph
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-stat hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-stat
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-map hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-map
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-rewr hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-rewr
/tool/pandora64/.package/emacs-23.2/share/emacs/site-lisp/calc-2.02f/calc-macs hides /tool/pandora64/.package/emacs-23.2/share/emacs/23.2/lisp/calc/calc-macs

Features:
(shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
qp ietf-drums mailabbrev nnheader mm-util mail-prsvr gmm-utils
mailheader canlock sha1 hex-util hashcash mail-utils emacsbug pp
find-func debug verilog-mode diff ange-ftp telnet tramp-imap assoc
tramp-gw tramp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp
auth-source gnus-util netrc time-date password-cache format-spec
tramp-compat trampver asm-mode cus-edit cus-start cus-load wid-edit
help-mode view sh-script executable dired-aux mule-util grep diff-mode
easy-mmode ebuff-menu electric multi-isearch c++-mode-diddles cc-mode
cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
etags ansi-color shell dired regexp-opt vc-p4 p4-lowlevel compile
ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult
ediff-init ediff paren skeleton advice help-fns advice-preload p4
easymenu comint ring error-if-boundp jka-compr cl cl-19 tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)