commit 98660df2502a6b2c92c651e6bc3f4a8be6143bb5 from: rsc date: Mon Feb 21 14:25:12 2005 UTC better symlink commit - 5db61d6221fc96c9734f96846193bfc66eee2d8f commit + 98660df2502a6b2c92c651e6bc3f4a8be6143bb5 blob - 8a748b9df21bb886ce7fcd5b11b6925e77013026 blob + ce2dcecd6edf0d6358f359f819988f8d920d1bcd --- src/lib9/_p9dir.c +++ src/lib9/_p9dir.c @@ -180,8 +180,7 @@ _p9dir(struct stat *lst, struct stat *st, char *name, d->mode |= DMDIR; d->qid.type = QTDIR; } - - if(S_ISLNK(st->st_mode)) + if(S_ISLNK(lst->st_mode)) /* yes, lst not st */ d->mode |= DMSYMLINK; if(S_ISFIFO(st->st_mode)) d->mode |= DMNAMEDPIPE; blob - 790b5fa057cb46a652b11bb0413f75c06ff83971 blob + 05b1ce616ed750330d8c4660da1a843b73484324 --- src/lib9/dirmodefmt.c +++ src/lib9/dirmodefmt.c @@ -35,16 +35,23 @@ dirmodefmt(Fmt *f) buf[0]='A'; else if(m & DMDEVICE) buf[0] = 'D'; - else if(m & DMSYMLINK) - buf[0] = 'L'; else if(m & DMSOCKET) buf[0] = 'S'; else if(m & DMNAMEDPIPE) buf[0] = 'P'; else buf[0]='-'; + + /* + * It's a little weird to have DMSYMLINK conflict with DMEXCL + * here, but since you can have symlinks to any of the above + * things, this is a better display. Especially since we don't do + * DMEXCL on any of the supported systems. + */ if(m & DMEXCL) buf[1]='l'; + else if(m & DMSYMLINK) + buf[1] = 'L'; else buf[1]='-'; rwx((m>>6)&7, buf+2);