diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2023-10-15 12:43:14 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2023-10-15 12:43:14 -0400 |
| commit | 582d39ab059acf8db3a819530bed5a1a2c44d009 (patch) | |
| tree | d19e5bbd02b37941e2eedbf776d2d44eaa418d8d | |
| parent | 9147b35b84553af718bc3a5281c0bd68badb630a (diff) | |
Show entire relative path for glob matches in subdirectories
| -rw-r--r-- | bb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -455,7 +455,10 @@ static entry_t* load_entry(bb_t *bb, const char *path) if (streq(entry->fullname, "/")) { entry->name = entry->fullname; } else { - entry->name = strrchr(entry->fullname, '/') + 1; // Last path component + if (strncmp(entry->fullname, bb->path, strlen(bb->path)) == 0) + entry->name = entry->fullname + strlen(bb->path); + else + entry->name = strrchr(entry->fullname, '/') + 1; // Last path component } if (S_ISLNK(filestat.st_mode)) entry->linkedmode = linkedstat.st_mode; |
