diff -u -r capsel-2.0rc1/ChangeLog capsel-2.0rc2/ChangeLog --- capsel-2.0rc1/ChangeLog Thu Jun 13 14:33:25 2002 +++ capsel-2.0rc2/ChangeLog Wed Jun 19 13:37:29 2002 @@ -1,3 +1,8 @@ +v2.0rc2 +~~~~~~~ +1) Capsel binary omits backup files in configuration directory + + v2.0rc1 ~~~~~~~ 1) Added module license (GPL) diff -u -r capsel-2.0rc1/src/user/main.c capsel-2.0rc2/src/user/main.c --- capsel-2.0rc1/src/user/main.c Thu Jun 13 13:49:45 2002 +++ capsel-2.0rc2/src/user/main.c Wed Jun 19 13:42:12 2002 @@ -31,19 +31,25 @@ int valid_filename(char * file) { char ** ext; + char * tmp; /* must begin with alpha-numeric or underscore character */ if (!isalnum(*file) && *file != '_') - return 0; + return 0; /* Invalid */ - file = strrchr(file, '.'); - if (!file) + tmp = strrchr(file, '.'); + if (!tmp) { + /* no extension -> check the last character */ + tmp = file + strlen(file) - 1; /* empty filename won't occur */ + if (!isalnum(*tmp) && *tmp != '_') + return 0; return 1; /* OK */ + } - file++; + tmp++; for (ext = exts; *ext; ext++) - if (!strcasecmp(file, *ext)) + if (!strcasecmp(tmp, *ext)) return 1; /* OK */ return 0; /* Invalid */