Skip to content

Commit 299a28a

Browse files
authored
g.region: fix save option behavior (#5627)
Adjust the region before saving it. Before, setting rows= and cols= had no effect on the saved region.
1 parent 813c420 commit 299a28a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

general/g.region/main.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -906,17 +906,16 @@ int main(int argc, char *argv[])
906906
}
907907
}
908908
}
909+
G_adjust_Cell_head3(&window, row_flag, col_flag, 0);
909910

910911
/* save= */
911912
if ((name = parm.save->answer)) {
912913
update_file = false;
913914
temp_window = window;
914-
G_adjust_Cell_head3(&temp_window, 0, 0, 0);
915915
if (G_put_element_window(&temp_window, "windows", name) < 0)
916916
G_fatal_error(_("Unable to set region <%s>"), name);
917917
}
918918

919-
G_adjust_Cell_head3(&window, row_flag, col_flag, 0);
920919
if (flag.force->answer || (update_file && !flag.noupdate->answer)) {
921920
if (G_put_window(&window) < 0)
922921
G_fatal_error(_("Unable to update current region"));

0 commit comments

Comments
 (0)