From d04970e568de8747a152db1ab036bbbfbf70f7f1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 24 Feb 2016 04:21:03 -0800 Subject: Exclude the file extension from the HRTF name --- Alc/hrtf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Alc/hrtf.c') diff --git a/Alc/hrtf.c b/Alc/hrtf.c index eeb4be41..9436ee55 100644 --- a/Alc/hrtf.c +++ b/Alc/hrtf.c @@ -514,6 +514,7 @@ static void AddFileEntry(vector_HrtfEntry *list, al_string *filename) struct Hrtf *hrtf = NULL; const HrtfEntry *iter; const char *name; + const char *ext; ALchar magic[8]; FILE *f; int i; @@ -575,10 +576,17 @@ static void AddFileEntry(vector_HrtfEntry *list, al_string *filename) /* TODO: Get a human-readable name from the HRTF data (possibly coming in a * format update). */ + ext = strrchr(name, '.'); i = 0; do { - al_string_copy_cstr(&entry.name, name); + if(!ext) + al_string_copy_cstr(&entry.name, name); + else + { + al_string_clear(&entry.name); + al_string_append_range(&entry.name, name, ext); + } if(i != 0) { char str[64]; -- cgit v1.2.3