00001 #include "gis.h"
00002 #include "glocale.h"
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00025 int G_legal_filename (char *s)
00026 {
00027 if (*s == '.' || *s == 0) {
00028 fprintf(stderr, _("Illegal filename. Cannot be '.' or 'NULL'\n"));
00029 return -1;
00030 }
00031
00032 for ( ; *s; s++)
00033 if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' || *s > 0176) {
00034 fprintf(stderr, _("Illegal filename. character <%c> not allowed."), *s);
00035 return -1;
00036 }
00037
00038 return 1;
00039 }