home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1992 November
/
CICA_MS_Windows_CD-ROM_Walnut_Creek_November_1992.iso
/
bbs
/
get_area.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-12
|
636b
|
36 lines
/*
* get_area.c
* get area description as line after path for pdsl disc
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void _Cdecl
main(int argc, char *argv[]) {
char buf[200];
int i;
if (argc != 3) {
fprintf(stderr, "usage: get_area [# spaces] [path] < input_file > output_file\n");
exit(1);
}
i = atoi(argv[1]);
while (NULL != gets(buf)) {
if (0 == stricmp(argv[2], buf)) {
if (NULL != gets(buf)) {
if (i)
printf("%*s%s\n", i, " ", buf);
else
printf("%s\n", buf);
}
exit(0);
}
}
fprintf(stderr, "no area found\n");
exit(1);
}