summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouie <lshprung@yahoo.com>2020-06-26 16:32:51 -0700
committerlouie <lshprung@yahoo.com>2020-06-26 16:32:51 -0700
commitf41dcb2b06bb379ff47a9f66cf509426706567f9 (patch)
treec5c7623bb36b11da6d1fc3a7149e2e5d00e5b4ca
parentcb03ecee3ad48a33ff72a2b86412846251ebee3e (diff)
Fixed trimming issue
-rw-r--r--draw.c13
-rw-r--r--read_cfg.obin5456 -> 5160 bytes
2 files changed, 3 insertions, 10 deletions
diff --git a/draw.c b/draw.c
index 4fc69a0..a95d618 100644
--- a/draw.c
+++ b/draw.c
@@ -182,21 +182,14 @@ void fill_entries(ENTRY **entry_arr, int count){
return;
}
-//FIXME issue trimming entries with path title
char *trim_name(char *name, char *path, int max_len){
- char *tok; //for use in finding relative path name
- char *tok_ahead;
- char *delims = "/\t\n";
+ char *relative;
//group name and path are equivalent: special procedure
if(!(strcmp(name, path))){
//find relative path name
- tok_ahead = strtok(name, delims);
- while(tok_ahead != NULL){
- tok = tok_ahead;
- tok_ahead = strtok(NULL, delims);
- }
- name = tok;
+ relative = strrchr(name, '/');
+ name = relative+1;
if(strlen(name) <= max_len) return name;
}
diff --git a/read_cfg.o b/read_cfg.o
index 75319b5..a978c2b 100644
--- a/read_cfg.o
+++ b/read_cfg.o
Binary files differ