4 * For each argument on the command line, echo it. Should expand
5 * DOS wildcards correctly.
7 * Syntax: libecho [-p prefix] list...
13 void echo_files(char *, char *);
16 main(int argc, char *argv[])
24 fprintf(stderr, "Usage: libecho [-p prefix] list...\n");
28 for (i = 1 ; i < argc ; i++)
29 if (!stricmp(argv[i], "-p"))
32 echo_files(prefix, argv[i]);
38 echo_files(char *prefix, char *f)
41 struct _finddata_t fdt;
46 * We're unix based quite a bit here. Look for normal slashes and
47 * make them reverse slashes.
49 while((slash = strrchr(f, '/')) != NULL)
54 slash = strrchr(filepath, '\\');
63 ff = _findfirst(f, &fdt);
66 printf("%s%s\n", prefix, f);
70 printf("%s%s%s\n", prefix, filepath, fdt.name);
73 if (_findnext(ff, &fdt) < 0)
75 printf("%s%s%s\n", prefix, filepath, fdt.name);