pkg: drop trailing whitespaces

This commit is contained in:
Stefano Sabatini 2022-11-21 10:11:53 +01:00
parent d97db4fae4
commit 113b28a7ae

54
pkg.c
View file

@ -1,6 +1,6 @@
/*
/*
* Copyright (C) 2001, 2002 Red Hat Inc.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
@ -10,7 +10,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@ -64,17 +64,17 @@ add_search_dirs (const char *path, const char *separator)
char **iter;
search_dirs = g_strsplit (path, separator, -1);
iter = search_dirs;
while (*iter)
{
debug_spew ("Adding directory '%s' from PKG_CONFIG_PATH\n",
*iter);
add_search_dir (*iter);
++iter;
}
g_strfreev (search_dirs);
}
@ -93,7 +93,7 @@ static gboolean
ends_in_dotpc (const char *str)
{
int len = strlen (str);
if (len > EXT_LEN &&
str[len - 3] == '.' &&
FOLD (str[len - 2]) == 'p' &&
@ -110,7 +110,7 @@ gboolean
name_ends_in_uninstalled (const char *str)
{
int len = strlen (str);
if (len > UNINSTALLED_LEN &&
FOLDCMP ((str + len - UNINSTALLED_LEN), "-uninstalled") == 0)
return TRUE;
@ -207,7 +207,7 @@ package_init (gboolean want_list)
{
if (packages)
return;
packages = g_hash_table_new (g_str_hash, g_str_equal);
if (want_list)
@ -228,14 +228,14 @@ internal_get_package (const char *name, gboolean warn)
unsigned int path_position = 0;
GList *iter;
GList *dir_iter;
pkg = g_hash_table_lookup (packages, name);
if (pkg)
return pkg;
debug_spew ("Looking for package '%s'\n", name);
/* treat "name" as a filename if it ends in .pc and exists */
if ( ends_in_dotpc (name) )
{
@ -256,14 +256,14 @@ internal_get_package (const char *name, gboolean warn)
pkg = internal_get_package (un, FALSE);
g_free (un);
if (pkg)
{
debug_spew ("Preferring uninstalled version of package '%s'\n", name);
return pkg;
}
}
for (dir_iter = search_dirs; dir_iter != NULL;
dir_iter = g_list_next (dir_iter))
{
@ -277,7 +277,7 @@ internal_get_package (const char *name, gboolean warn)
}
}
if (location == NULL)
{
if (warn)
@ -318,7 +318,7 @@ internal_get_package (const char *name, gboolean warn)
debug_spew ("Path position of '%s' is %d\n",
pkg->key, pkg->path_position);
debug_spew ("Adding '%s' to list of known packages\n", pkg->key);
g_hash_table_insert (packages, pkg->key, pkg);
@ -427,7 +427,7 @@ flag_list_to_string (GList *list)
GList *tmp;
GString *str = g_string_new ("");
char *retval;
tmp = list;
while (tmp != NULL) {
Flag *flag = tmp->data;
@ -467,7 +467,7 @@ pathposcmp (gconstpointer a, gconstpointer b)
{
const Package *pa = a;
const Package *pb = b;
if (pa->path_position < pb->path_position)
return -1;
else if (pa->path_position > pb->path_position)
@ -664,7 +664,7 @@ verify_package (Package *pkg)
"Internal pkg-config error, package with no key, please file a bug report\n");
exit (1);
}
if (pkg->name == NULL)
{
verbose_error ("Package '%s' has no Name: field\n",
@ -685,7 +685,7 @@ verify_package (Package *pkg)
pkg->key);
exit (1);
}
/* Make sure we have the right version for all requirements */
iter = pkg->requires_private;
@ -716,7 +716,7 @@ verify_package (Package *pkg)
exit (1);
}
}
iter = g_list_next (iter);
}
@ -732,7 +732,7 @@ verify_package (Package *pkg)
while (requires_iter != NULL)
{
Package *req = requires_iter->data;
conflicts_iter = conflicts;
while (conflicts_iter != NULL)
@ -758,10 +758,10 @@ verify_package (Package *pkg)
conflicts_iter = g_list_next (conflicts_iter);
}
requires_iter = g_list_next (requires_iter);
}
g_list_free (requires);
/* We make a list of system directories that compilers expect so we
@ -984,9 +984,9 @@ define_global_variable (const char *varname,
verbose_error ("Variable '%s' defined twice globally\n", varname);
exit (1);
}
g_hash_table_insert (globals, g_strdup (varname), g_strdup (varval));
debug_spew ("Global variable definition '%s' = '%s'\n",
varname, varval);
}
@ -1110,7 +1110,7 @@ version_test (ComparisonType comparison,
case ALWAYS_MATCH:
return TRUE;
break;
default:
g_assert_not_reached ();
break;
@ -1151,7 +1151,7 @@ comparison_to_str (ComparisonType comparison)
case ALWAYS_MATCH:
return "(any)";
break;
default:
g_assert_not_reached ();
break;