aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/find.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index febe688b..65beeb54 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -321,7 +321,8 @@ static int do_find(struct dirtree *new)
if (new && s[i] == 'p') name = path = dirtree_path(new, 0);
if (i) {
if (check || !new) {
- name = strlower(new ? name : arg);
+ char *temp = new ? name : arg;
+ name = temp ? strlower(temp) : 0;
if (!new) {
dlist_add(&TT.argdata, name);
free(path);