Skip to content

Commit

Permalink
Only show warning to convert old userfile for actual old userfiles
Browse files Browse the repository at this point in the history
Found by: Many, many, many people
Patch by: Cizzle

Will now show a warning (a fatal one) that the userfile is invalid instead of the almost always incorrect suggestion to weed out the old userfile.

Eggdrop v4 userfiles date back to around mid 1997 so v3 or even older ones are probably not around anymore. Corrupt (v4) userfiles however still trigger this warning as currently coded.
  • Loading branch information
Cizzle authored and vanosg committed Dec 17, 2017
1 parent 373f7e9 commit cdb6ab6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/users.c
Expand Up @@ -693,10 +693,10 @@ int readuserfile(char *file, struct userrec **ret)
/* read opening comment */ /* read opening comment */
s = buf; s = buf;
if (fgets(s, 180, f) != NULL) { if (fgets(s, 180, f) != NULL) {
if (s[1] < '4') { if (s[0] == '#' && s[1] < '4' && s[1] >= '0' && s[2] == 'v') {
fatal(USERF_OLDFMT, 0); fatal(USERF_OLDFMT, 0);
} }
if (s[1] > '4') if (s[0] != '#' || s[1] > '4' || s[2] != 'v')
fatal(USERF_INVALID, 0); fatal(USERF_INVALID, 0);
} }
/* don't check for feof after fgets, skips last line if it has no \n (ie on windows) */ /* don't check for feof after fgets, skips last line if it has no \n (ie on windows) */
Expand Down

0 comments on commit cdb6ab6

Please sign in to comment.