summaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
authorlouie <lshprung@yahoo.com>2020-07-10 17:23:52 -0700
committerlouie <lshprung@yahoo.com>2020-07-10 17:23:52 -0700
commit03fff71fa937d385a2b260d58443fb81ce303fb2 (patch)
treee45403d0d17e55eb0733db2ea77176480839b119 /entry.c
parent7378343295af76d0cb33f725d3052b1557ac1b2e (diff)
Removed unnecessary checks from create_entry, added addF option^C
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/entry.c b/entry.c
index b7c240c..c47b5d7 100644
--- a/entry.c
+++ b/entry.c
@@ -22,26 +22,11 @@ char *get_epath(ENTRY *e);
ENTRY *create_entry(char *new_name, char *new_path){
ENTRY *new;
- char adjusted_path[BUF_LEN];
-
- //double check if file exists
- if(access(new_path, F_OK) == -1){
- //try to adjust the path, in case of lingering quotes
- strcpy(adjusted_path, &new_path[1]);
- adjusted_path[strlen(adjusted_path)-1] = '\0';
-
- if(access(adjusted_path, F_OK) == -1){
- printf("Error: Invalid File Name \"%s\"\n", new_path);
- return NULL;
- }
- }
-
- else strcpy(adjusted_path, new_path);
new = malloc(sizeof(ENTRY));
strcpy(new->name, new_name);
- strcpy(new->path, adjusted_path);
+ strcpy(new->path, new_path);
new->next = NULL;
return new;