summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--surf.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/surf.c b/surf.c
index a36af8f..d7bb88c 100644
--- a/surf.c
+++ b/surf.c
@@ -60,14 +60,14 @@ typedef struct {
KeyFocus focus;
} Key;
-SoupCookieJar *cookiejar;
-SoupSession *session;
-Client *clients = NULL;
-Cookie *cookies = NULL;
-GdkNativeWindow embed = 0;
-gboolean showxid = FALSE;
-gboolean ignore_once = FALSE;
-gchar *workdir;
+static SoupCookieJar *cookiejar;
+static SoupSession *session;
+static Client *clients = NULL;
+/*static Cookie *cookies = NULL;*/
+static GdkNativeWindow embed = 0;
+static gboolean showxid = FALSE;
+static gboolean ignore_once = FALSE;
+static gchar *workdir;
extern char *optarg;
extern gint optind;
@@ -123,6 +123,7 @@ void
cleanup(void) {
while(clients)
destroyclient(clients);
+ g_free(workdir);
}
void
@@ -590,7 +591,7 @@ setup(void) {
/* create dirs and files */
home = g_get_home_dir();
- workdir = g_build_filename(home, ".surf", NULL);
+ workdir = g_strdup(g_build_filename(home, ".surf", NULL));
g_mkdir_with_parents(workdir, 0755);
name = g_build_filename(workdir, "dl", NULL);
g_mkdir(name, 0755);
@@ -720,6 +721,7 @@ int main(int argc, char *argv[]) {
default:
usage();
}
+ setup();
if(optind + 1 == argc) {
c = newclient();
arg.v = argv[optind];
@@ -731,7 +733,6 @@ int main(int argc, char *argv[]) {
}
else if(optind != argc)
usage();
- setup();
if(!clients)
newclient();
an class='insertions'>+35 2024-09-08added support for cli args for lua scriptsGravatar BanceDev 4-3/+28 2024-09-07added --version flagGravatar BanceDev 1-1/+9 2024-09-07fixed error in install.sh instructionsGravatar BanceDev 1-1/+1 2024-09-07fixed bug with cursor alignment when adding text within the bufferGravatar BanceDev 1-1/+11 2024-09-06added API guide to readmeGravatar BanceDev 1-1/+5 2024-09-06Update README.mdGravatar Lance Borden 1-1/+1 2024-09-06better readmeGravatar BanceDev 2-2/+14 t/.github/workflows/build.yml?id=ee88d0087d4d17d974f39b0e9a7b6f35b4cfc91c&follow=1'>temporary github action fix until non-interactive mode is implementedGravatar BanceDev 1-2/+2 2024-09-12attempt to update build script to accept input into lush shellGravatar BanceDev 2-4/+6 2024-09-12prevent lush workflow from getting stuck in testsGravatar Lance Borden 1-1/+4 2024-09-12removed chsh in workflowGravatar Lance Borden 1-4/+1