From: Bert Vermeulen Date: Tue, 1 Feb 2011 00:41:33 +0000 (+0100) Subject: don't force .sigrok extension when saving session file X-Git-Tag: libsigrok-0.1.0~355 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4a1b18f86d71ce814ec65b5273c1fdc4ac224735;p=libsigrok.git don't force .sigrok extension when saving session file --- diff --git a/session_file.c b/session_file.c index 015927d2..88dfe4f5 100644 --- a/session_file.c +++ b/session_file.c @@ -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';