]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/write_entry.c
ncurses 5.9 - patch 20111217
[ncurses.git] / ncurses / tinfo / write_entry.c
index 3f6eebfcb33d9ae1f35fac5b5dfde2c3b591d776..b1daf1649e2086389b45c263538c68e4e3224d42 100644 (file)
@@ -47,7 +47,7 @@
 #define TRACE_OUT(p)           /*nothing */
 #endif
 
 #define TRACE_OUT(p)           /*nothing */
 #endif
 
-MODULE_ID("$Id: write_entry.c,v 1.81 2011/10/22 15:33:37 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.82 2011/10/30 14:33:13 tom Exp $")
 
 static int total_written;
 
 
 static int total_written;
 
@@ -127,18 +127,17 @@ make_db_path(char *dst, const char *src, size_t limit)
     }
 #if USE_HASHED_DB
     if (rc == 0) {
     }
 #if USE_HASHED_DB
     if (rc == 0) {
-       if (_nc_is_dir_path(dst)) {
-           rc = -1;
-       } else {
-           static const char suffix[] = DBM_SUFFIX;
-           size_t have = strlen(dst);
-           size_t need = strlen(suffix);
-           if (have > need && strcmp(dst + (int) (have - need), suffix)) {
-               if (have + need <= limit)
-                   strcat(dst, suffix);
-               else
-                   rc = -1;
+       static const char suffix[] = DBM_SUFFIX;
+       size_t have = strlen(dst);
+       size_t need = strlen(suffix);
+       if (have > need && strcmp(dst + (int) (have - need), suffix)) {
+           if (have + need <= limit) {
+               strcat(dst, suffix);
+           } else {
+               rc = -1;
            }
            }
+       } else if (_nc_is_dir_path(dst)) {
+           rc = -1;
        }
     }
 #endif
        }
     }
 #endif
@@ -158,10 +157,11 @@ make_db_root(const char *path)
 #if USE_HASHED_DB
        DB *capdbp;
 
 #if USE_HASHED_DB
        DB *capdbp;
 
-       if ((capdbp = _nc_db_open(fullpath, TRUE)) == NULL)
+       if ((capdbp = _nc_db_open(fullpath, TRUE)) == NULL) {
            rc = -1;
            rc = -1;
-       else if (_nc_db_close(capdbp) < 0)
+       } else if (_nc_db_close(capdbp) < 0) {
            rc = -1;
            rc = -1;
+       }
 #else
        struct stat statbuf;
 
 #else
        struct stat statbuf;