1 From cd444949f3176790101b8bdc9656831a03d8c01d Mon Sep 17 00:00:00 2001
2 From: Paul Fertser <fercerpav@gmail.com>
3 Date: Tue, 10 Jul 2012 11:13:29 +0400
4 Subject: [PATCH 2/3] Use the current directory for storing and loading
7 This allows the user to always explicitely choose (by changing the
8 current directory before launching the program) where the session
9 files should go. Useful e.g. to avoid hogging the precious space on
10 embedded devices, just cd /tmp before starting the app.
12 Signed-off-by: Paul Fertser <fercerpav@gmail.com>
14 src/session.c | 16 +++-------------
15 1 files changed, 3 insertions(+), 13 deletions(-)
17 diff --git a/src/session.c b/src/session.c
18 index d3af0c3..308f213 100644
21 @@ -62,7 +62,7 @@ int restore_session()
22 memset(file, 0, FILENAME_MAX);
24 bssid = mac2str(get_bssid(), '\0');
25 - snprintf(file, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
26 + snprintf(file, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
30 @@ -199,18 +199,8 @@ int save_session()
35 - * If the configuration directory exists, save the session file there; else, save it to the
36 - * current working directory.
38 - if(configuration_directory_exists())
40 - snprintf((char *) &file_name, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
44 - snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
46 + /* save session to the current directory */
47 + snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
50 /* Don't bother saving anything if nothing has been done */