From 8ec8e9d5dd37eac5266f8cd94ce946f23f436ef9 Mon Sep 17 00:00:00 2001 From: louie Date: Sat, 11 Jul 2020 08:57:14 -0700 Subject: Fixed bug when compmode is on and an entry is forced --- entry.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'entry.c') diff --git a/entry.c b/entry.c index c47b5d7..7431b64 100644 --- a/entry.c +++ b/entry.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -11,22 +12,24 @@ typedef struct entry{ char name[BUF_LEN]; char path[BUF_LEN]; + bool path_force; struct entry *next; } ENTRY; -ENTRY *create_entry(char *new_name, char *new_path); +ENTRY *create_entry(char *new_name, char *new_path, bool force); ENTRY *entry_add_last(ENTRY *tail, ENTRY *add); ENTRY **get_entries(ENTRY *head, int count); char *get_ename(ENTRY *e); char *get_epath(ENTRY *e); -ENTRY *create_entry(char *new_name, char *new_path){ +ENTRY *create_entry(char *new_name, char *new_path, bool force){ ENTRY *new; new = malloc(sizeof(ENTRY)); strcpy(new->name, new_name); strcpy(new->path, new_path); + new->path_force = force; new->next = NULL; return new; @@ -66,6 +69,11 @@ char *get_epath(ENTRY *e){ return e->path; } +bool get_eforce(ENTRY *e){ + assert(e != NULL); + return e->path_force; +} + void entry_debug(ENTRY *trav){ while(trav != NULL){ -- cgit