[yelp] Don't use stdout as a variable name.
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] Don't use stdout as a variable name.
- Date: Tue, 14 Jun 2011 23:30:18 +0000 (UTC)
commit e6e1bfec226fd91decd4ef972637589f38dc5e4d
Author: Antoine Jacoutot <ajacoutot openbsd org>
Date: Wed Jun 15 00:08:27 2011 +0200
Don't use stdout as a variable name.
stdout is defined in stdio.h which breaks the compilation under (at
least) OpenBSD and it is usually considered bad pratice to use such
generic variable names.
libyelp/yelp-man-parser.c | 6 +++---
libyelp/yelp-uri.c | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/libyelp/yelp-man-parser.c b/libyelp/yelp-man-parser.c
index 4001d38..3c75642 100644
--- a/libyelp/yelp-man-parser.c
+++ b/libyelp/yelp-man-parser.c
@@ -369,7 +369,7 @@ yelp_man_parser_new (void)
static GInputStream*
get_troff (gchar *path, GError **error)
{
- gint stdout;
+ gint ystdout;
GError *err = NULL;
gchar *argv[] = { "man", "-Z", "-Tutf8", "-EUTF-8", NULL, NULL };
@@ -377,7 +377,7 @@ get_troff (gchar *path, GError **error)
if (!g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_SEARCH_PATH, NULL, NULL,
- NULL, NULL, &stdout, NULL, &err)) {
+ NULL, NULL, &ystdout, NULL, &err)) {
/* We failed to run the man program. Return a "Huh?" error. */
*error = g_error_new (YELP_ERROR, YELP_ERROR_UNKNOWN,
err->message);
@@ -385,7 +385,7 @@ get_troff (gchar *path, GError **error)
return NULL;
}
- return (GInputStream*) g_unix_input_stream_new (stdout, TRUE);
+ return (GInputStream*) g_unix_input_stream_new (ystdout, TRUE);
}
xmlDocPtr
diff --git a/libyelp/yelp-uri.c b/libyelp/yelp-uri.c
index 53a550f..b5ff304 100644
--- a/libyelp/yelp-uri.c
+++ b/libyelp/yelp-uri.c
@@ -876,7 +876,7 @@ static gchar*
find_man_path (gchar* name, gchar* section)
{
gchar* argv[] = { "man", "-w", NULL, NULL, NULL };
- gchar *stdout = NULL;
+ gchar *ystdout = NULL;
gint status;
gchar **lines;
GError *error = NULL;
@@ -893,21 +893,21 @@ find_man_path (gchar* name, gchar* section)
if (!g_spawn_sync (NULL, argv, NULL,
G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL,
- &stdout, NULL, &status, &error)) {
+ &ystdout, NULL, &status, &error)) {
g_warning ("Couldn't find path for %s(%s). Error: %s",
name, section, error->message);
g_error_free (error);
}
if (status == 0) {
- lines = g_strsplit (stdout, "\n", 2);
- g_free (stdout);
- stdout = g_strdup (lines[0]);
+ lines = g_strsplit (ystdout, "\n", 2);
+ g_free (ystdout);
+ ystdout = g_strdup (lines[0]);
g_strfreev (lines);
- return stdout;
+ return ystdout;
} else {
- g_free (stdout);
+ g_free (ystdout);
return NULL;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]