mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Once again improve existing filename handling
Several potential problems. - we could end up dereferencing exiting_filename when it was NULL - we could free the default_filename by mistake - subsurface_default_filename always needs to return a copy of it - closing the existing file before opening a new one repopulated the existing_filename with the default filename - preventing the opened file to become the new existing filename Also, make existing filename a const char * and make file_open have the same sensible default folder behavior as the other file related functions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fa2f1b6eb0
commit
7148dea827
5 changed files with 23 additions and 12 deletions
2
dive.h
2
dive.h
|
@ -463,7 +463,7 @@ const char *monthname(int mon);
|
|||
extern const char *star_strings[];
|
||||
|
||||
extern const char *default_filename;
|
||||
extern char *existing_filename;
|
||||
extern const char *existing_filename;
|
||||
extern const char *subsurface_default_filename(void);
|
||||
#define AIR_PERMILLE 209
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue