mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 06:25:44 +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, '/');
|
const char *s = strrchr(filename, '/');
|
||||||
char *r = strdup(filename);
|
char *r = strdup(filename);
|
||||||
if (r && s)
|
if (r) {
|
||||||
r[s - filename] = '\0';
|
if (s)
|
||||||
|
r[s - filename] = '\0';
|
||||||
|
else if (r[0])
|
||||||
|
strcpy(r, ".");
|
||||||
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue