mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 03:35:42 +01:00
topology: fix the include path parsing
When the last '/' is not found use '.' as the source path. Fixes: https://github.com/alsa-project/alsa-utils/issues/123 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
e18913110b
commit
7692cfa0c5
1 changed files with 6 additions and 2 deletions
|
@ -240,8 +240,12 @@ static char *get_inc_path(const char *filename)
|
|||
{
|
||||
const char *s = strrchr(filename, '/');
|
||||
char *r = strdup(filename);
|
||||
if (r && s)
|
||||
if (r) {
|
||||
if (s)
|
||||
r[s - filename] = '\0';
|
||||
else if (r[0])
|
||||
strcpy(r, ".");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue