From 43fd3ede73152146db4847e9ae0973c7a7684aa5 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 17 Feb 2003 05:23:20 +0000 Subject: [PATCH] * Fixed a small bug in the GDBM backend (deprecated, but the bug was very obvious and a kind user pointed it out) * Removed vestiges of setjmp/longjmp from the client * When doing .TS, don't get caught in a constant-logout loop --- citadel/ChangeLog | 7 ++++++- citadel/citadel.c | 35 +++++++++++++++++++---------------- citadel/database.c | 4 ++-- citadel/routines2.c | 1 - 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 208ebfcd2..b582a8bcb 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,10 @@ $Log$ + Revision 601.134 2003/02/17 05:23:20 ajc + * Fixed a small bug in the GDBM backend (deprecated, but the bug was very + obvious and a kind user pointed it out) + * Removed vestiges of setjmp/longjmp from the client + * When doing .TS, don't get caught in a constant-logout loop + Revision 601.133 2003/02/14 16:12:04 ajc * Added support for any standard RBL @@ -4472,4 +4478,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.c b/citadel/citadel.c index 40e8e3d38..bc55bca1a 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -62,14 +61,13 @@ struct march *march = NULL; /* globals associated with the client program */ -char temp[PATH_MAX]; /* Name of general temp file */ -char temp2[PATH_MAX]; /* Name of general temp file */ -char tempdir[PATH_MAX]; /* Name of general temp dir */ +char temp[PATH_MAX]; /* Name of general-purpose temp file */ +char temp2[PATH_MAX]; /* Name of general-purpose temp file */ +char tempdir[PATH_MAX]; /* Name of general-purpose temp directory */ char editor_paths[MAX_EDITORS][SIZ]; /* paths to external editors */ char printcmd[SIZ]; /* print command */ int editor_pid = (-1); char fullname[USERNAME_SIZE]; -jmp_buf nextbuf; struct CtdlServInfo serv_info; /* Info on the server connected */ int screenwidth; int screenheight; @@ -114,25 +112,27 @@ CtdlIPC *ipc_for_signal_handlers; /* KLUDGE cover your eyes */ */ void logoff(CtdlIPC *ipc, int code) { - int lp; + int lp; + if (editor_pid > 0) { /* kill the editor if it's running */ kill(editor_pid, SIGHUP); } - /* Free the ungoto list */ - for (lp = 0; lp < uglistsize; lp++) - free (uglist[lp]); + /* Free the ungoto list */ + for (lp = 0; lp < uglistsize; lp++) { + free(uglist[lp]); + } -/* shut down the server... but not if the logoff code is 3, because - * that means we're exiting because we already lost the server +/* Shut down the server connection ... but not if the logoff code is 3, + * because that means we're exiting because we already lost the server. */ - if (code != 3) + if (code != 3) { CtdlIPCQuit(ipc); + } /* * now clean up various things */ - screen_delete(); unlink(temp); @@ -175,8 +175,8 @@ void catch_sigcont(int signum) } - /* general purpose routines */ + /* display a file */ void formout(CtdlIPC *ipc, char *name) { @@ -355,8 +355,9 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto) uglistlsn[lp] = uglistlsn[lp+1]; } ugpos--; - } else + } else { uglistsize++; + } uglist[ugpos] = malloc(strlen(room_name)+1); strcpy(uglist[ugpos], room_name); @@ -1430,8 +1431,9 @@ NEWUSR: if (strlen(rc_password) == 0) { break; case 29: case 30: - if (!rc_alt_semantics) + if (!rc_alt_semantics) { updatels(ipc); + } termn8 = 1; break; case 48: @@ -1714,6 +1716,7 @@ NEWUSR: if (strlen(rc_password) == 0) { } while (termn8 == 0); TERMN8: scr_printf("%s logged out.", fullname); + termn8 = 0; color(ORIGINAL_PAIR); scr_printf("\n"); while (march != NULL) { diff --git a/citadel/database.c b/citadel/database.c index 7ea713051..934cd69e1 100644 --- a/citadel/database.c +++ b/citadel/database.c @@ -406,8 +406,8 @@ void cdb_trunc(int cdb) { datum key; begin_critical_section(S_DATABASE); - key = gdbm_firstkey ( dbf ); - while (key = gdbm_firstkey(gdbms[cdb], key.dptr != NULL) { + key = gdbm_firstkey (gdbms[cdb]); + while (key = gdbm_firstkey(gdbms[cdb], key.dptr) { gdbm_delete(gdbms[cdb], key); } end_critical_section(S_DATABASE); diff --git a/citadel/routines2.c b/citadel/routines2.c index fbfeb4e6a..56982df02 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -29,7 +29,6 @@ #include #include -#include #include #include #include "citadel.h" -- 2.30.2