1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00

24951: implement ZLS_COLORS ln=target

This commit is contained in:
Peter Stephenson 2008-05-06 16:01:18 +00:00
parent da037f7393
commit dbe5fd93a7
5 changed files with 78 additions and 30 deletions

View file

@ -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;
}