aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-09-01 21:05:24 -0700
committerChris Robinson <[email protected]>2016-09-01 21:05:24 -0700
commit17636a0c1c6cc7916d2b3f659b5a701266bcab36 (patch)
tree5d02f2c8d59a85eb7df0c4bba362218eddeafc00 /Alc/hrtf.c
parent7428636071f0977f7479ed5a03b5786c64850105 (diff)
Calculate a variable closer to where it's used
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index d189ad35..19829034 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -691,11 +691,6 @@ static void AddFileEntry(vector_HrtfEntry *list, al_string *filename)
const char *ext;
int i;
- name = strrchr(al_string_get_cstr(*filename), '/');
- if(!name) name = strrchr(al_string_get_cstr(*filename), '\\');
- if(!name) name = al_string_get_cstr(*filename);
- else ++name;
-
#define MATCH_FNAME(i) (al_string_cmp_cstr(*filename, (i)->hrtf->filename) == 0)
VECTOR_FIND_IF(iter, const HrtfEntry, *list, MATCH_FNAME);
if(iter != VECTOR_END(*list))
@@ -759,6 +754,11 @@ static void AddFileEntry(vector_HrtfEntry *list, al_string *filename)
skip_load:
/* TODO: Get a human-readable name from the HRTF data (possibly coming in a
* format update). */
+ name = strrchr(al_string_get_cstr(*filename), '/');
+ if(!name) name = strrchr(al_string_get_cstr(*filename), '\\');
+ if(!name) name = al_string_get_cstr(*filename);
+ else ++name;
+
ext = strrchr(name, '.');
i = 0;