Skip to content

Commit

Permalink
Fix for #1, when there are no subdirs, just wavs under /grnltr
Browse files Browse the repository at this point in the history
  • Loading branch information
jazamatronic committed Sep 1, 2023
1 parent f4715e5 commit 09b9946
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions grnltr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,12 @@ int ReadWavsFromDir(const char *dir_path)

void LoadNewDir() {
strcpy(cur_dir_name, GRNLTR_PATH);
strcat(cur_dir_name, "/");
strcat(cur_dir_name, &dir_names[cur_dir][0]);
// If there are no dirs, just wavs under /grnltr
// From https://github.com/jazamatronic/grnltr/issues/1
if (strlen(&dir_names[cur_dir][0]) > 0) {
strcat(cur_dir_name, "/");
strcat(cur_dir_name, &dir_names[cur_dir][0]);
}
if (ReadWavsFromDir(cur_dir_name) < 0) {
Status(DIR_ERROR);

Expand Down

0 comments on commit 09b9946

Please sign in to comment.