]> sigrok.org Git - libsigrok.git/commitdiff
don't force .sigrok extension when saving session file
authorBert Vermeulen <redacted>
Tue, 1 Feb 2011 00:41:33 +0000 (01:41 +0100)
committerBert Vermeulen <redacted>
Tue, 1 Feb 2011 00:41:33 +0000 (01:41 +0100)
session_file.c

index 015927d2a2d00c6289276ae427f8f0d5faa2a14b..88dfe4f5bb96a1bc28aeaec587b63d5aef31a8bf 100644 (file)
@@ -147,18 +147,12 @@ int session_save(char *filename)
        struct zip_source *versrc, *metasrc, *logicsrc;
        int bufcnt, devcnt, tmpfile, ret, error, probecnt;
        uint64_t samplerate;
-       char version[1], rawname[16], metafile[32], *newfn, *buf, *s;
-
-       newfn = g_malloc(strlen(filename) + 10);
-       strcpy(newfn, filename);
-       if (strstr(filename, ".sigrok") != filename+strlen(filename)-7)
-               strcat(newfn, ".sigrok");
+       char version[1], rawname[16], metafile[32], *buf, *s;
 
        /* Quietly delete it first, libzip wants replace ops otherwise. */
-       unlink(newfn);
-       if (!(zipfile = zip_open(newfn, ZIP_CREATE, &error)))
+       unlink(filename);
+       if (!(zipfile = zip_open(filename, ZIP_CREATE, &error)))
                return SR_ERR;
-       g_free(newfn);
 
        /* "version" */
        version[0] = '1';