don't force .sigrok extension when saving session file

This commit is contained in:
Bert Vermeulen 2011-02-01 01:41:33 +01:00
parent b8c2f85f56
commit 4a1b18f86d
1 changed files with 3 additions and 9 deletions

View 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';