mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-05-24 09:48:16 +02:00
Strip trailing space from --cflags/--libs output
pkg-config leaves a trailing space on the flags output as it may have to do multiple iterations to collect all output and adding the space makes concatenation simple. However, this leaves a trailing space on the full returned string unless it's empty. Strip the trailing space after all the processing is complete.
This commit is contained in:
parent
dbf1b7cd09
commit
f26a505826
1 changed files with 4 additions and 0 deletions
4
pkg.c
4
pkg.c
|
|
@ -989,6 +989,10 @@ packages_get_flags (GList *pkgs, FlagType flags)
|
|||
g_free (cur);
|
||||
}
|
||||
|
||||
/* Strip trailing space. */
|
||||
if (str->len > 0 && str->str[str->len - 1] == ' ')
|
||||
g_string_truncate (str, str->len - 1);
|
||||
|
||||
debug_spew ("returning flags string \"%s\"\n", str->str);
|
||||
return g_string_free (str, FALSE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue