version 1.22, 2000/06/23 16:15:49 |
version 1.23, 2000/06/23 16:41:52 |
|
|
{ |
{ |
Lst_AtEnd(expansions, |
Lst_AtEnd(expansions, |
(isDot ? estrdup(entry->name) : |
(isDot ? estrdup(entry->name) : |
str_concat(p->name, entry->name, |
str_concat(p->name, entry->name, '/'))); |
STR_ADDSLASH))); |
|
} |
} |
} |
} |
return (0); |
return (0); |
|
|
continue; |
continue; |
} |
} |
} |
} |
file = str_concat (p->name, cp, STR_ADDSLASH); |
file = str_concat(p->name, cp, '/'); |
if (DEBUG(DIR)) { |
if (DEBUG(DIR)) { |
printf("returning %s\n", file); |
printf("returning %s\n", file); |
} |
} |
|
|
while ((ln = Lst_Next (path)) != NULL) { |
while ((ln = Lst_Next (path)) != NULL) { |
p = (Path *)Lst_Datum(ln); |
p = (Path *)Lst_Datum(ln); |
if (p != dot) { |
if (p != dot) { |
file = str_concat (p->name, name, STR_ADDSLASH); |
file = str_concat(p->name, name, '/'); |
} else { |
} else { |
/* |
/* |
* Checking in dot -- DON'T put a leading ./ on the thing. |
* Checking in dot -- DON'T put a leading ./ on the thing. |
|
|
char *flag; /* flag which should precede each directory */ |
char *flag; /* flag which should precede each directory */ |
Lst path; /* list of directories */ |
Lst path; /* list of directories */ |
{ |
{ |
char *str; /* the string which will be returned */ |
|
char *tstr; /* the current directory preceded by 'flag' */ |
|
LstNode ln; /* the node of the current directory */ |
LstNode ln; /* the node of the current directory */ |
Path *p; /* the structure describing the current directory */ |
BUFFER buf; |
|
|
str = estrdup(""); |
Buf_Init(&buf, 0); |
|
|
Lst_Open(path); |
for (ln = Lst_First(path); ln != NULL; ln = Lst_Adv(ln)) { |
while ((ln = Lst_Next(path)) != NULL) { |
Buf_AddString(&buf, flag); |
p = (Path *)Lst_Datum(ln); |
Buf_AddString(&buf, ((Path *)Lst_Datum(ln))->name); |
tstr = str_concat(flag, p->name, 0); |
Buf_AddSpace(&buf); |
str = str_concat(str, tstr, STR_ADDSPACE | STR_DOFREE); |
|
} |
} |
Lst_Close(path); |
|
|
|
return str; |
return Buf_Retrieve(&buf); |
} |
} |
|
|
/*- |
/*- |