diff options
author | louie <lshprung@yahoo.com> | 2020-06-22 21:08:10 -0700 |
---|---|---|
committer | louie <lshprung@yahoo.com> | 2020-06-22 21:08:10 -0700 |
commit | 43eeda3d0982160d7863dd2268d989f79c24f03f (patch) | |
tree | 8beca0a69f63b520683148f3a265b8b5806c7f6b /entry.c | |
parent | 4ca501cb1ded2bf4466a28fcad28a6b7c60d8aff (diff) |
Altered Group Structure and cfg
Diffstat (limited to 'entry.c')
-rw-r--r-- | entry.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -14,29 +14,25 @@ typedef struct entry{ struct entry *next; } ENTRY; -ENTRY *create_entry(char *new_path, char *new_group); +ENTRY *create_entry(char *new_name, char *new_path); 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_path, char *new_group){ +ENTRY *create_entry(char *new_name, char *new_path){ ENTRY *new; - char full_path[BUF_LEN] = ""; - - if(new_group != NULL) strcat(full_path, new_group); - strcat(full_path, new_path); //check if file exists - if(access(full_path, F_OK) == -1){ - printf("Error: Invalid File Name \"%s\"\n", full_path); + if(access(new_path, F_OK) == -1){ + printf("Error: Invalid File Name \"%s\"\n", new_path); return NULL; } new = malloc(sizeof(ENTRY)); - strcpy(new->name, new_path); - strcpy(new->path, full_path); + strcpy(new->name, new_name); + strcpy(new->path, new_path); new->next = NULL; return new; |