$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
#include <sys/ioctl.h>
#include <signal.h>
#include <pwd.h>
-#include <setjmp.h>
#include <stdarg.h>
#include <errno.h>
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;
*/
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);
}
-
/* general purpose routines */
+
/* display a file */
void formout(CtdlIPC *ipc, char *name)
{
uglistlsn[lp] = uglistlsn[lp+1];
}
ugpos--;
- } else
+ } else {
uglistsize++;
+ }
uglist[ugpos] = malloc(strlen(room_name)+1);
strcpy(uglist[ugpos], room_name);
break;
case 29:
case 30:
- if (!rc_alt_semantics)
+ if (!rc_alt_semantics) {
updatels(ipc);
+ }
termn8 = 1;
break;
case 48:
} while (termn8 == 0);
TERMN8: scr_printf("%s logged out.", fullname);
+ termn8 = 0;
color(ORIGINAL_PAIR);
scr_printf("\n");
while (march != NULL) {
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);