mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:33:23 +00:00
Don't set a default filename when called with multiple filenames
The behavior is just too illogical - it's too easy to unintentionally overwrite a file this way. The default filename is set if we have exactly one filename on the command line or if we we open the default file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7c26432186
commit
29ae8cb131
1 changed files with 5 additions and 3 deletions
8
main.c
8
main.c
|
@ -335,10 +335,12 @@ int main(int argc, char **argv)
|
|||
parse_argument(a);
|
||||
continue;
|
||||
}
|
||||
no_filenames = FALSE;
|
||||
GError *error = NULL;
|
||||
parse_file(a, &error, TRUE);
|
||||
|
||||
/* if we have exactly one filename, parse_file will set
|
||||
* that to be the default. Otherwise there will be no default filename */
|
||||
set_filename(NULL, TRUE);
|
||||
parse_file(a, &error, no_filenames);
|
||||
no_filenames = FALSE;
|
||||
if (error != NULL)
|
||||
{
|
||||
report_error(error);
|
||||
|
|
Loading…
Add table
Reference in a new issue