Prevent crash if logbook "global" is accessed

SVN revision: 1746
This commit is contained in:
Stefan Ritt 2006-11-08 12:50:02 +00:00
parent e8a8c76860
commit 8a6096353a

View File

@ -24504,7 +24504,7 @@ void server_loop(void)
for (i = 0;; i++) {
if (!enumgrp(i, str))
break;
if (strieq(logbook, str))
if (strieq(logbook, str) && !strieq(logbook, "global"))
break;
}
@ -25677,6 +25677,10 @@ int main(int argc, char *argv[])
if (!logbook_dir[0])
strcpy(logbook_dir, "logbooks");
/* strip trailing dir separator */
if (logbook_dir[strlen(logbook_dir)-1] == DIR_SEPARATOR)
logbook_dir[strlen(logbook_dir)-1] = 0;
/* check for directories */
if (logbook_dir[0] && stat(logbook_dir, &finfo) < 0) {