فهرست منبع

Prioritise uncompressed null file over compressed null file (issue https://trac.osgeo.org/grass/ticket/2349)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65273 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 10 سال پیش
والد
کامیت
57ff07fef6
1فایلهای تغییر یافته به همراه11 افزوده شده و 10 حذف شده
  1. 11 10
      lib/raster/open.c

+ 11 - 10
lib/raster/open.c

@@ -338,18 +338,19 @@ int Rast__open_old(const char *name, const char *mapset)
 	}
 	}
 	else {
 	else {
 	    /* First, check for compressed null file */
 	    /* First, check for compressed null file */
-	    fcb->null_fd = G_open_old_misc("cell_misc", NULL2_FILE, r_name, r_mapset);
-	    if (fcb->null_fd >= 0) {
-		fcb->null_row_ptr = G_calloc(fcb->cellhd.rows + 1, sizeof(off_t));
-		if (Rast__read_null_row_ptrs(fd, fcb->null_fd) < 0) {
-		    close(fcb->null_fd);
-		    fcb->null_fd = -1;
-		    G_free(fcb->null_row_ptr);
-		    fcb->null_row_ptr = NULL;
+	    fcb->null_fd = G_open_old_misc("cell_misc", NULL_FILE, r_name, r_mapset);
+	    if (fcb->null_fd < 0) {
+		fcb->null_fd = G_open_old_misc("cell_misc", NULL2_FILE, r_name, r_mapset);
+		if (fcb->null_fd >= 0) {
+		    fcb->null_row_ptr = G_calloc(fcb->cellhd.rows + 1, sizeof(off_t));
+		    if (Rast__read_null_row_ptrs(fd, fcb->null_fd) < 0) {
+			close(fcb->null_fd);
+			fcb->null_fd = -1;
+			G_free(fcb->null_row_ptr);
+			fcb->null_row_ptr = NULL;
+		    }
 		}
 		}
 	    }
 	    }
-	    if (fcb->null_fd < 0)
-		fcb->null_fd = G_open_old_misc("cell_misc", NULL_FILE, r_name, r_mapset);
 	    fcb->null_file_exists = fcb->null_fd >= 0;
 	    fcb->null_file_exists = fcb->null_fd >= 0;
 	}
 	}
     }
     }