summaryrefslogtreecommitdiffstats
path: root/file.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 /file.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 'file.c')
-rw-r--r--file.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/file.c b/file.c
index 8deb2fe97..401bd5c36 100644
--- a/file.c
+++ b/file.c
@@ -263,7 +263,7 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, GError
parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, error);
}
-void parse_file(const char *filename, GError **error, gboolean possible_default_filename)
+void parse_file(const char *filename, GError **error)
{
struct memblock mem;
#ifdef SQLITE3
@@ -283,19 +283,9 @@ void parse_file(const char *filename, GError **error, gboolean possible_default_
filename);
}
- /*
- * We do *not* want to leave the old default_filename
- * just because the open failed.
- */
- if (possible_default_filename)
- set_filename(filename, TRUE);
-
return;
}
- if (possible_default_filename)
- set_filename(filename, TRUE);
-
#ifdef SQLITE3
fmt = strrchr(filename, '.');
if (fmt && (!strcasecmp(fmt + 1, "DB") || !strcasecmp(fmt + 1, "BAK"))) {