about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-12 21:48:30 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-12 21:48:30 +0000
commit4e1a569e598f825a4760656bb7f1e90f21187e23 (patch)
tree583a05e56706f6a272e013c7bff9eb136145edf5 /Src/glob.c
parent35c56beaa9307a91cfebe18b2b4e04dfd51b079c (diff)
downloadzsh-4e1a569e598f825a4760656bb7f1e90f21187e23.tar.gz
zsh-4e1a569e598f825a4760656bb7f1e90f21187e23.tar.xz
zsh-4e1a569e598f825a4760656bb7f1e90f21187e23.zip
zsh-workers/7404
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/glob.c b/Src/glob.c
index b8c535a6f..2df5270c2 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1971,8 +1971,11 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr)
 				*ptr = sav;
 			    }
 			}
-			if (!--n || (n <= 0 && (fl & SUB_GLOBAL)))
+			if (!--n || (n <= 0 && (fl & SUB_GLOBAL))) {
 			    *sp = get_match_ret(*sp, t-s, mpos-s, fl, replstr);
+			    if (mpos == start)
+				mpos++;
+			}
 			if (!(fl & SUB_GLOBAL)) {
 			    if (n) {
 				/*