From d42f707d1412b1fe5b24c5417992ab47b74466f7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 7 Jan 2006 23:19:55 +0000 Subject: [PATCH] Remove newlines from debug output git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- src/NetworkManagerUtils.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index f88ead1d9a..ed9808f175 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -767,7 +767,19 @@ nm_utils_supplicant_request_with_check (struct wpa_ctrl *ctrl, wpa_ctrl_request (ctrl, command, strlen (command), response, &len, NULL); response[len] = '\0'; #ifdef SUPPLICANT_DEBUG - nm_info ("SUP: response was '%s'", response); + { + gboolean newline = FALSE; + + /* Kill the newline for the debug message */ + if (response[len - 1] == '\n') + { + newline = TRUE; + response[len - 1] = '\0'; + } + nm_info ("SUP: response was '%s'", response); + if (newline) + response[len - 1] = '\n'; + } #endif if (response) @@ -776,10 +788,22 @@ nm_utils_supplicant_request_with_check (struct wpa_ctrl *ctrl, success = TRUE; else { + gboolean newline = FALSE; + + /* Kill the newline for the debug message */ + if (response[len - 1] == '\n') + { + newline = TRUE; + response[len - 1] = '\0'; + } + temp = g_strdup_printf ("%s: supplicant error for '%s'. Response: '%s'", func, err_msg_cmd ? err_msg_cmd : command, response); nm_warning_str (temp); g_free (temp); + + if (newline) + response[len - 1] = '\n'; } g_free (response); }