summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/utils.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b8af2130c..5ce58d8e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-09  Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+	* 33932: Src/utils.c: revise boundary check in unmeta()
+
 2014-12-08  Oliver Kiddle  <opk@zsh.org>
 
 	* 33924: Doc/Zsh/zle.yo, Src/Zle/iwidgets.list, Src/Zle/zle.h,
diff --git a/Src/utils.c b/Src/utils.c
index 5c90638a2..ab3d3da93 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4208,10 +4208,8 @@ unmeta(const char *file_name)
     
     meta = 0;
     for (t = file_name; *t; t++) {
-	if (*t == Meta) {
-	    meta = t[1];
-	    break;
-	}
+	if (*t == Meta)
+	    meta = 1;
     }
     if (!meta) {
 	/*
@@ -4250,7 +4248,7 @@ unmeta(const char *file_name)
     }
 
     for (t = file_name, p = fn; *t; p++)
-	if ((*p = *t++) == Meta)
+	if ((*p = *t++) == Meta && *t)
 	    *p = *t++ ^ 32;
     *p = '\0';
     return fn;