[PATCH] Ignore pictures when parsing divelogs.de import

Miika Turkia miika.turkia at gmail.com
Mon Oct 13 11:31:01 PDT 2014


Do not do XML parse on pictures. Currently just ignore them, in the
future we might want to save them somewhere and include them in
Subsurface logs.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 file.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/file.c b/file.c
index 1859e39..b1e258b 100644
--- a/file.c
+++ b/file.c
@@ -89,6 +89,9 @@ static int try_to_open_zip(const char *filename, struct memblock *mem)
 			struct zip_file *file = zip_fopen_index(zip, index, 0);
 			if (!file)
 				break;
+			/* skip parsing the divelogs.de pictures */
+			if (strstr(zip_get_name(zip, index, 0), "pictures/"))
+				continue;
 			zip_read(file, filename);
 			zip_fclose(file);
 			success++;
-- 
1.9.1



More information about the subsurface mailing list