summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Alberto Mardegan <mardy@users.sourceforge.net>2013-04-02 18:46:41 +0300
committerGravatar Alberto Mardegan <mardy@users.sourceforge.net>2013-04-02 19:55:44 +0300
commit2f759f52e12e2e065f6022797dc51106a7093899 (patch)
treec0c4c6ec66f6ce3e774d6b5545d28d3fcb4b5023 /main.c
parent40e3671bd2656be9657abe8c6d955cef612805c5 (diff)
downloadsubsurface-2f759f52e12e2e065f6022797dc51106a7093899.tar.gz
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: Alberto Mardegan <mardy@users.sourceforge.net>
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.c b/main.c
index 3b6e00449..3c0ea7381 100644
--- a/main.c
+++ b/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);