mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Move set_filename() calls outside of parse_file()
Remove the boolean parameter from parse_file; the code is more readable by having an explicit call to set_filename() where necessary, rather than a boolean parameter. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
This commit is contained in:
parent
0b8462bd58
commit
68119c5b54
4 changed files with 12 additions and 17 deletions
10
main.c
10
main.c
|
|
@ -348,8 +348,12 @@ int main(int argc, char **argv)
|
|||
/* 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;
|
||||
parse_file(a, &error);
|
||||
if (no_filenames)
|
||||
{
|
||||
set_filename(a, TRUE);
|
||||
no_filenames = FALSE;
|
||||
}
|
||||
if (error != NULL)
|
||||
{
|
||||
report_error(error);
|
||||
|
|
@ -360,7 +364,7 @@ int main(int argc, char **argv)
|
|||
if (no_filenames) {
|
||||
GError *error = NULL;
|
||||
const char *filename = prefs.default_filename;
|
||||
parse_file(filename, &error, TRUE);
|
||||
parse_file(filename, &error);
|
||||
/* don't report errors - this file may not exist, but make
|
||||
sure we remember this as the filename in use */
|
||||
set_filename(filename, FALSE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue