* Fixed a small bug in the GDBM backend (deprecated, but the bug was very
authorArt Cancro <ajc@citadel.org>
Mon, 17 Feb 2003 05:23:20 +0000 (05:23 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 17 Feb 2003 05:23:20 +0000 (05:23 +0000)
  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
citadel/citadel.c
citadel/database.c
citadel/routines2.c

index 208ebfcd22312b19e61c14e8f298d4f79a0c3e3a..b582a8bcb1290b89909c23681406d93c5a1c3816 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 40e8e3d38b764a0d8166960b891146aa31e2e99c..bc55bca1a3bb8afca8342f118f276ad47f7e18d7 100644 (file)
@@ -30,7 +30,6 @@
 #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;
@@ -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) {
index 7ea71305133c5c68e9ab51fa2cb8b350a59a4354..934cd69e13c315596d89eb61988ce25004c7a6cd 100644 (file)
@@ -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);
index fbfeb4e6a8ad7af6c8cd44f76b79daa01868c585..56982df02ca7fd1ffa4a4b44e585db12bfa6ebb4 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <signal.h>
 #include <pwd.h>
-#include <setjmp.h>
 #include <errno.h>
 #include <stdarg.h>
 #include "citadel.h"