1
0
mirror of https://github.com/PDP-10/its.git synced 2026-04-18 00:57:09 +00:00
Files
PDP-10.its/arc/ar5:c/C10EXP C
2018-05-15 07:06:17 +02:00

51 lines
965 B
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# include "c/c.defs"
/**********************************************************************
EXPAND ARGUMENT VECTOR CONTAINING FILE NAME PATTERNS
**********************************************************************/
static char **next;
static char *bufp;
int exparg (argc, argv, outv, buffer)
char *argv[], *outv[], buffer[];
{int i, expfs();
char *s;
bufp = buffer;
next = outv;
i = 0;
while (i<argc)
{s = argv[i++];
if (expmagic (s)) mapdir (s, expfs);
else *next++ = s;
}
return (next-outv);
}
int expmagic (s) /* does it contain magic pattern chars? */
char *s;
{int c, flag;
flag = FALSE;
while (c = *s++) switch (c) {
case '?':
case '*': flag = TRUE; continue;
case '/': flag = FALSE; continue;
case '\\': if (*s) ++s; continue;
}
return (flag);
}
expfs (fs)
filespec *fs;
{char *prfile (), *p;
p = bufp;
bufp = (prfile (fs, bufp)) + 1;
*next++ = p;
}