From fcb804effea60a9b7af3b40fdad5c49eda8fd6c9 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Thu, 14 Jul 2005 13:05:17 +0000 Subject: 2002-09-06 Havoc Pennington Author: hp Date: 2002-09-06 20:00:08 GMT 2002-09-06 Havoc Pennington * parse.c, pkg.c: handle other_libs other_cflags same as -l/-L/-I flags, so we pull in from dependent packages. Closes #85244, #90706, #89851 --- parse.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index d1a66b4..4cd32ee 100644 --- a/parse.c +++ b/parse.c @@ -587,7 +587,6 @@ parse_libs (Package *pkg, const char *str, const char *path) /* Strip out -l and -L flags, put them in a separate list. */ char *trimmed; - GString *other; char **argv = NULL; int argc; int result; @@ -620,8 +619,6 @@ parse_libs (Package *pkg, const char *str, const char *path) exit (1); } - - other = g_string_new (""); i = 0; while (i < argc) @@ -675,9 +672,9 @@ parse_libs (Package *pkg, const char *str, const char *path) } else { - g_string_append_c (other, ' '); - g_string_append (other, arg); - g_string_append_c (other, ' '); + if (*arg != '\0') + pkg->other_libs = g_slist_prepend (pkg->other_libs, + g_strdup (arg)); } g_free (arg); @@ -688,12 +685,9 @@ parse_libs (Package *pkg, const char *str, const char *path) g_free (argv); g_free (trimmed); - pkg->other_libs = other->str; - - g_string_free (other, FALSE); - pkg->l_libs = g_slist_reverse (pkg->l_libs); pkg->L_libs = g_slist_reverse (pkg->L_libs); + pkg->other_libs = g_slist_reverse (pkg->other_libs); } static void @@ -702,7 +696,6 @@ parse_cflags (Package *pkg, const char *str, const char *path) /* Strip out -I flags, put them in a separate list. */ char *trimmed; - GString *other; char **argv = NULL; int argc; int result; @@ -726,8 +719,6 @@ parse_cflags (Package *pkg, const char *str, const char *path) exit (1); } - - other = g_string_new (""); i = 0; while (i < argc) @@ -761,9 +752,9 @@ parse_cflags (Package *pkg, const char *str, const char *path) } else { - if (other->len > 0) - g_string_append (other, " "); - g_string_append (other, arg); + if (*arg != '\0') + pkg->other_cflags = g_slist_prepend (pkg->other_cflags, + g_strdup (arg)); } g_free (arg); @@ -774,11 +765,8 @@ parse_cflags (Package *pkg, const char *str, const char *path) g_free (argv); g_free (trimmed); - pkg->other_cflags = other->str; - - g_string_free (other, FALSE); - pkg->I_cflags = g_slist_reverse (pkg->I_cflags); + pkg->other_cflags = g_slist_reverse (pkg->other_cflags); } static void -- cgit v1.2.1