aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorgrai <t.lainson@gmail.com>2008-07-22 03:22:33 +1000
committergrai <t.lainson@gmail.com>2008-07-22 03:22:33 +1000
commit91b79c582c09ad9e8c3b860b3a388a540f926fc1 (patch)
treea9a624d32334b0d41e02593a0ed3b62fd379710d /src/cmd/9p.c
parentdce4cbabd1bbfa3a8acc05ae0b2c3a9df17f93d2 (diff)
downloadplan9port-91b79c582c09ad9e8c3b860b3a388a540f926fc1.tar.gz
plan9port-91b79c582c09ad9e8c3b860b3a388a540f926fc1.tar.bz2
plan9port-91b79c582c09ad9e8c3b860b3a388a540f926fc1.zip
9p: honour the -l flag to ls
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 105fd3a1..ed80f5a6 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -554,18 +554,25 @@ xls(int argc, char **argv)
len[j] = l;
}
}
- for(i=0; i<n; i++)
+ for(i=0; i<n; i++){
+ if(!lflag){
+ print("%q\n", d[i].name);
+ continue;
+ }
print("%M %C %*d %*s %*s %*lld %T %q\n",
d[i].mode, d[i].type, len[0], d[i].dev,
-len[1], d[i].uid, -len[2], d[i].gid,
len[3], d[i].length, d[i].mtime, d[i].name);
-
+ }
}else{
d->type = 'M';
d->dev = 0;
- print("%M %C %d %s %s %lld %T %q\n",
- d->mode, d->type, d->dev,
- d->uid, d->gid, d->length, d->mtime, d->name);
+ if(lflag)
+ print("%M %C %d %s %s %lld %T %q\n",
+ d->mode, d->type, d->dev,
+ d->uid, d->gid, d->length, d->mtime, d->name);
+ else
+ print("%q\n", d->name);
}
free(d);
}