home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
-
- main()
- {
- char *p;
- char buf[BUFSIZ];
-
- while ( fgets(buf,BUFSIZ,stdin) != NULL ) {
- if ( (p = strchr(buf,'\n')) != NULL )
- *p = '\0';
-
- for ( p = buf ; *p != '\0' ; p++ ) {
- if ( !isalpha(*p) && !isdigit(*p) &&
- *p != '_' && *p != '.' && *p != ':' && *p != '\\' ) {
- printf("%s Bad Char '%c'\n",buf,*p);
- break;
- }
- }
-
- if ( (p = strrchr(buf,'\\')) != NULL ) {
- *p = '\0';
- if ( (p = strchr(buf,'.')) != NULL )
- printf("%s Bad Directory '%s'\n",buf,p);
- }
- }
- }