From 55ebfc0d61f84966e2f21a8a318840388893741a Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 14 Sep 2010 11:29:42 +0000 Subject: [PATCH] Ignore directories passed on the command-line (based on patch by Erik de Castro Lopo, thanks). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5226 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ src/main.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 62e3a59a..d024b397 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-09-14 Nick Treleaven + + * src/main.c: + Ignore directories passed on the command-line (based on patch by + Erik de Castro Lopo, thanks). + + 2010-09-13 Nick Treleaven * src/interface.c, src/keybindings.c, src/ui_utils.c, geany.glade: diff --git a/src/main.c b/src/main.c index 05b6f5fb..99d78250 100644 --- a/src/main.c +++ b/src/main.c @@ -794,6 +794,13 @@ static gboolean open_cl_files(gint argc, gchar **argv) for (i = 1; i < argc; i++) { gchar *filename = main_get_argv_filename(argv[i]); + + if (g_file_test(filename, G_FILE_TEST_IS_DIR)) + { + g_free(filename); + continue; + } + #ifdef G_OS_WIN32 /* It seems argv elements are encoded in CP1252 on a German Windows */ setptr(filename, g_locale_to_utf8(filename, -1, NULL, NULL, NULL));