home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
dec92.zip
/
1012074B
< prev
next >
Wrap
Text File
|
1992-10-13
|
499b
|
27 lines
/* find2.c: A case-insensitive substring search */
#include <stdio.h>
#include <string.h>
#define WIDTH 128
main(int argc, char *argv[])
{
char line[WIDTH], lline[WIDTH];
char *search_str;
if (argc == 1)
return 1; /* Search string required */
search_str = argv[1];
strlwr(search_str);
while (gets(line))
{
strlwr(strcpy(lline,line));
if (strstr(lline,search_str))
puts(line);
}
return 0;
}