Permalink
Browse files

Only show warning to convert old userfile for actual old userfiles

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 cdb6ab65c4d9fd570c047429502234ba93ba3e89
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/users.c
View
@@ -693,10 +693,10 @@ int readuserfile(char *file, struct userrec **ret)
/* read opening comment */
s = buf;
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);
}
if (s[1] > '4')
if (s[0] != '#' || s[1] > '4' || s[2] != 'v')
fatal(USERF_INVALID, 0);
}
/* don't check for feof after fgets, skips last line if it has no \n (ie on windows) */

0 comments on commit cdb6ab6

Please sign in to comment.