aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-02-23 18:05:40 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-02-23 18:05:40 -0800
commit8820fda592b3d382d6d7814fbbb13b51fb33b822 (patch)
treee692619b797092c9a2e3c1eee2447f1ebca2be17
parente1338716532199b2b8b300f9b78b0cabbf284796 (diff)
Fixed selection issue.
-rw-r--r--bb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bb.c b/bb.c
index 1be0085..327a787 100644
--- a/bb.c
+++ b/bb.c
@@ -292,7 +292,10 @@ entry_t* load_entry(bb_t *bb, const char *path)
if (!path || !path[0]) return NULL;
if (lstat(path, &filestat) == -1) return NULL;
char pbuf[PATH_MAX];
- sprintf(pbuf, "%s%s", bb->path, path);
+ if (path[0] == '/')
+ strcpy(pbuf, path);
+ else
+ sprintf(pbuf, "%s%s", bb->path, path);
if (pbuf[strlen(pbuf)-1] == '/' && pbuf[1])
pbuf[strlen(pbuf)-1] = '\0';