From 5ee2e091adf1aca46eb5e93c7733fff9c8ce6500 Mon Sep 17 00:00:00 2001 From: louie Date: Mon, 6 Jul 2020 11:17:29 -0700 Subject: get_epath bug fix --- draw.c | 14 ++++++++++---- entry.c | 1 - entry.o | Bin 3888 -> 3888 bytes 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/draw.c b/draw.c index 58a0ad0..bebd82e 100644 --- a/draw.c +++ b/draw.c @@ -310,12 +310,15 @@ void trav_col(int dir){ return; } +//TODO clean up quotes void launch_entry(){ char *program = get_gprog(g[g_hover]); char *flags = get_gflags(g[g_hover]); char *path = get_epath(e[e_hover]); int mode = get_compmode(); char full_command[BUF_LEN]; + bool quote_flag_f = (flags[0] == '"' ? false : true); + bool quote_flag_e = (path[0] == '"' ? false : true); //if the entry is an executable file (doesn't have a launcher) if(!(strcmp(program, "./"))) system(path); @@ -324,14 +327,17 @@ void launch_entry(){ if(mode != 0) path = compat_convert(path, mode); full_command[0] = '\0'; strcat(full_command, program); - strcat(full_command, " \""); if(flags[0] !='\0'){ + strcat(full_command, " "); + if(quote_flag_f) strcat(full_command, "\""); strcat(full_command, flags); - strcat(full_command, "\""); - strcat(full_command, " \""); + if(quote_flag_f) strcat(full_command, "\""); } + strcat(full_command, " "); + if(quote_flag_e) strcat(full_command, "\""); strcat(full_command, path); - strcat(full_command, "\""); + if(quote_flag_e) strcat(full_command, "\""); + mvprintw(0, 0, "DEBUG: %s", full_command); system(full_command); } diff --git a/entry.c b/entry.c index 46cb6b4..b7c240c 100644 --- a/entry.c +++ b/entry.c @@ -78,7 +78,6 @@ char *get_ename(ENTRY *e){ } char *get_epath(ENTRY *e){ assert(e != NULL); - return e->name; return e->path; } diff --git a/entry.o b/entry.o index 83836f3..ce61e81 100644 Binary files a/entry.o and b/entry.o differ -- cgit