summaryrefslogtreecommitdiff
path: root/Src/Zle/compcore.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-05-06 16:01:18 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-05-06 16:01:18 +0000
commitdbe5fd93a7f29a6f800d470fff3c1b946ec3fdb4 (patch)
tree8adafc6ea84f9a9e1dff5ec5d48a7d57abae5855 /Src/Zle/compcore.c
parentda037f7393b55680ad913d96affd157fe0ab550a (diff)
downloadzsh-dbe5fd93a7f29a6f800d470fff3c1b946ec3fdb4.tar.gz
zsh-dbe5fd93a7f29a6f800d470fff3c1b946ec3fdb4.zip
24951: implement ZLS_COLORS ln=target
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r--Src/Zle/compcore.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index e66c1f71d..79de193cd 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2784,8 +2784,8 @@ add_match_data(int alt, char *str, char *orig, Cline line,
(complist ?
((strstr(complist, "packed") ? CMF_PACKED : 0) |
(strstr(complist, "rows") ? CMF_ROWS : 0)) : 0));
- cm->mode = 0;
- cm->modec = '\0';
+ cm->mode = cm->fmode = 0;
+ cm->modec = cm->fmodec = '\0';
if ((flags & CMF_FILE) && orig[0] && orig[strlen(orig) - 1] != '/') {
struct stat buf;
char *pb;
@@ -2799,6 +2799,11 @@ add_match_data(int alt, char *str, char *orig, Cline line,
if ((cm->modec = file_type(buf.st_mode)) == ' ')
cm->modec = '\0';
}
+ if (!ztat(pb, &buf, 0)) {
+ cm->fmode = buf.st_mode;
+ if ((cm->fmodec = file_type(buf.st_mode)) == ' ')
+ cm->fmodec = '\0';
+ }
}
if ((*compqstack == QT_BACKSLASH && compqstack[1]) ||
(autoq && *compqstack && compqstack[1] == QT_BACKSLASH))
@@ -3208,6 +3213,8 @@ dupmatch(Cmatch m, int nbeg, int nend)
r->disp = ztrdup(m->disp);
r->mode = m->mode;
r->modec = m->modec;
+ r->fmode = m->fmode;
+ r->fmodec = m->fmodec;
return r;
}