diff options
author | louie <lshprung@yahoo.com> | 2020-07-10 16:34:54 -0700 |
---|---|---|
committer | louie <lshprung@yahoo.com> | 2020-07-10 16:34:54 -0700 |
commit | 7378343295af76d0cb33f725d3052b1557ac1b2e (patch) | |
tree | 40da4c79b73997bb3ff10cfcb3bc43d9f81dd9a9 /draw.c | |
parent | 2ca6074cfcf99d89d665b7ebe3d2768c2adce2fe (diff) |
Fixed bugs related to Executables
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -361,16 +361,25 @@ char *get_launch(){ char *path = get_epath(e[e_hover]); int mode = get_compmode(); char *full_command = malloc(sizeof(char) * BUF_LEN); + bool quote_flag_p = (program[0] == '"' ? false : true); bool quote_flag_f = (flags[0] == '"' ? false : true); bool quote_flag_e = (path[0] == '"' ? false : true); + full_command[0] = '\0'; + //if the entry is an executable file (doesn't have a launcher) - if(!(strcmp(program, "./"))) return path; + if(!(strcmp(program, "./"))){ + if(quote_flag_e) strcat(full_command, "\""); + strcat(full_command, path); + if(quote_flag_e) strcat(full_command, "\""); + return full_command; + } else{ if(mode != 0) path = compat_convert(path, mode); - full_command[0] = '\0'; + if(quote_flag_p) strcat(full_command, "\""); strcat(full_command, program); + if(quote_flag_p) strcat(full_command, "\""); if(flags[0] !='\0'){ strcat(full_command, " "); if(quote_flag_f) strcat(full_command, "\""); |