mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
9p: honour the -l flag to ls
This commit is contained in:
parent
dce4cbabd1
commit
91b79c582c
1 changed files with 12 additions and 5 deletions
17
src/cmd/9p.c
17
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue