[geany/geany] c2c6a7: Open files with leading or trailing whitespaces through the socket

Colomban Wendling git-noreply at xxxxx
Wed Aug 8 13:35:46 UTC 2012


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 08 Aug 2012 13:35:46
Commit:      c2c6a70515d8863347b7022bcf35970b933c1a57
             https://github.com/geany/geany/commit/c2c6a70515d8863347b7022bcf35970b933c1a57

Log Message:
-----------
Open files with leading or trailing whitespaces through the socket


Modified Paths:
--------------
    src/socket.c

Modified: src/socket.c
8 files changed, 7 insertions(+), 1 deletions(-)
===================================================================
@@ -611,7 +611,13 @@ gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpoint
 			cl_options.readonly = strncmp(buf+4, "ro", 2) == 0; /* open in readonly? */
 			while (socket_fd_gets(sock, buf, sizeof(buf)) != -1 && *buf != '.')
 			{
-				handle_input_filename(g_strstrip(buf));
+				gsize buf_len = strlen(buf);
+
+				/* remove trailing newline */
+				if (buf_len > 0 && buf[buf_len - 1] == '\n')
+					buf[buf_len - 1] = '\0';
+
+				handle_input_filename(buf);
 			}
 			popup = TRUE;
 		}


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list