Compare commits

...

2 Commits

Author SHA1 Message Date
nova
f5d0c8bc85 deletion of unused vars 2026-05-14 23:15:24 +02:00
nova
9e8bd3c022 parse_path 2026-05-14 23:10:06 +02:00
3 changed files with 38 additions and 6 deletions

View File

@@ -131,5 +131,40 @@ char* parse_cmd(const char *cmd, file *f){
} }
return out; return out;
}
char* parse_path(char *path){
int count = 0;
char *out;
char *pos;
unsigned long i = 0;
while(path[i]) {
if (path[i] == '\'') {
count++;
}
i++;
}
out = malloc((strlen(path)+(count*3)) + 4);
pos = out;
pos++;
out[0] = '\'';
i = 0;
while(path[i]) {
if (path[i] == '\'') {
*pos++ = '\'';
*pos++ = '\\';
*pos++ = '\'';
}
*pos = path[i];
pos++;
i++;
}
pos[0] = '\'';
pos[1]= ' ';
pos[2] = '\0';
return out;
} }

2
dir.c
View File

@@ -17,8 +17,6 @@ extern unsigned int settings;
extern unsigned int file_modifiers; extern unsigned int file_modifiers;
extern unsigned int color_count; extern unsigned int color_count;
extern unsigned int terminal_height; extern unsigned int terminal_height;
extern volatile unsigned long selected_file_current;
extern volatile unsigned long selected_file_last;
extern color *colors; extern color *colors;
int (*order_func)() = sort_natural; int (*order_func)() = sort_natural;
linked_dir *visited_dirs; linked_dir *visited_dirs;

5
main.c
View File

@@ -19,8 +19,8 @@ unsigned int terminal_width;
unsigned int temp_heigth = 0; /*used for screen refresh*/ unsigned int temp_heigth = 0; /*used for screen refresh*/
unsigned int temp_width = 0; unsigned int temp_width = 0;
unsigned int settings; unsigned int settings;
unsigned int file_modifiers; unsigned int file_modifiers = 0;
unsigned int status = (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY); unsigned int status = (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_MASK | STATUS_RELOAD_DIRECTORY) & ~STATUS_UPDATE_SCREEN_RESIZE;
char *start_path; char *start_path;
char *global_path; char *global_path;
time_t seed; time_t seed;
@@ -36,7 +36,6 @@ extern pthread_mutex_t mutex_btm;
extern pthread_mutex_t mutex_lft; extern pthread_mutex_t mutex_lft;
extern pthread_mutex_t mutex_mid; extern pthread_mutex_t mutex_mid;
extern pthread_mutex_t mutex_rgt; extern pthread_mutex_t mutex_rgt;
extern volatile char render_queue[5];
char *input; /*used in user_interactions*/ char *input; /*used in user_interactions*/
char *terminal_width_empty_line; /* used in user_interactions */ char *terminal_width_empty_line; /* used in user_interactions */