summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-09-08 16:32:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-09-08 16:32:44 +0000
commit154b7351f4b246077ef03217f33b11de27c350f9 (patch)
treebe6f07952bcfbb4331f87bbc8f659f5d88c55207
parent82b6ee09bcf4d6ac45af226dc4a0243974f18db1 (diff)
downloadzsh-154b7351f4b246077ef03217f33b11de27c350f9.tar.gz
zsh-154b7351f4b246077ef03217f33b11de27c350f9.tar.xz
zsh-154b7351f4b246077ef03217f33b11de27c350f9.zip
unposted: safety on regexp errors in replace-string-again
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Zle/replace-string-again4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d7e000929..49a2eb69a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-09-08  Peter Stephenson  <pws@csr.com>
 
+	* unposted: Functions/Zle/replace-string-again: safety on
+	regexp failures.
+
 	* 28244 with typo noted by Mikael and Bart: NEWS: updated 4.3.11
 	news.
 
@@ -13615,5 +13618,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5073 $
+* $Revision: 1.5074 $
 *****************************************************
diff --git a/Functions/Zle/replace-string-again b/Functions/Zle/replace-string-again
index 83a24167e..f24c14f88 100644
--- a/Functions/Zle/replace-string-again
+++ b/Functions/Zle/replace-string-again
@@ -40,8 +40,8 @@ if [[ $curwidget = *(pattern|regex)* ]]; then
     rep2+=$rep
     if [[ $curwidget = *regex* ]]; then
       autoload -Uz regexp-replace
-      regexp-replace LBUFFER $_replace_string_src $rep2
-      regexp-replace RBUFFER $_replace_string_src $rep2
+      regexp-replace LBUFFER $_replace_string_src $rep2 || return 1
+      regexp-replace RBUFFER $_replace_string_src $rep2 || return 1
     else
       LBUFFER=${LBUFFER//(#bm)$~_replace_string_src/${(e)rep2}}
       RBUFFER=${RBUFFER//(#bm)$~_replace_string_src/${(e)rep2}}