mirror of
https://github.com/leahneukirchen/mblaze
synced 2024-11-15 18:14:02 +00:00
parent
e6dcea66dd
commit
011a13463f
13
mlist.c
13
mlist.c
@ -168,6 +168,19 @@ listdir(char *dir)
|
|||||||
void
|
void
|
||||||
listarg(char *arg)
|
listarg(char *arg)
|
||||||
{
|
{
|
||||||
|
char *s, *t;
|
||||||
|
|
||||||
|
// squeeze slashes
|
||||||
|
s = t = arg;
|
||||||
|
while ((*s++ = *t))
|
||||||
|
if (*t++ == '/')
|
||||||
|
while (*t == '/')
|
||||||
|
t++;
|
||||||
|
// remove trailing slashes
|
||||||
|
s--;
|
||||||
|
while (*--s == '/')
|
||||||
|
*s = 0;
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(arg, &st) < 0)
|
if (stat(arg, &st) < 0)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user