diff options
author | Andrés <andmarti@gmail.com> | 2021-06-16 11:15:10 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-06-16 11:15:10 -0300 |
commit | 793bc4899f6433690b714828423c5c298bdf0f79 (patch) | |
tree | 0c747b5c6f416b5dd215bb5f3a173972983d58ae | |
parent | 54af1d02875e7e56be326d43fe9a9b0832ea0da1 (diff) |
Check curfile is set for autobackup - issue #580
-rw-r--r-- | src/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2011,10 +2011,10 @@ int plugin_exists(char * name, int len, char * path) { void * do_autobackup() { struct sheet * sh = session->cur_doc->cur_sh; char * curfile = session->cur_doc->name; - int len = strlen(curfile); + int len; + if (curfile == NULL || ! (len = strlen(curfile))) return (void *) -1; //if (session->cur_doc->loading || ! len) return (void *) -1; //if (! len || ! session->cur_doc->modflg) return (void *) -1; - if (! len) return (void *) -1; char * pstr = strrchr(curfile, '/'); int pos = pstr == NULL ? -1 : pstr - curfile; |