Revision: 5226
http://geany.svn.sourceforge.net/geany/?rev=5226&view=rev
Author: ntrel
Date: 2010-09-14 11:29:42 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
Ignore directories passed on the command-line (based on patch by
Erik de Castro Lopo, thanks).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/main.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-09-13 15:37:46 UTC (rev 5225)
+++ trunk/ChangeLog 2010-09-14 11:29:42 UTC (rev 5226)
@@ -1,3 +1,10 @@
+2010-09-14 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/main.c:
+ Ignore directories passed on the command-line (based on patch by
+ Erik de Castro Lopo, thanks).
+
+
2010-09-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/interface.c, src/keybindings.c, src/ui_utils.c, geany.glade:
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2010-09-13 15:37:46 UTC (rev 5225)
+++ trunk/src/main.c 2010-09-14 11:29:42 UTC (rev 5226)
@@ -794,6 +794,13 @@
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));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5224
http://geany.svn.sourceforge.net/geany/?rev=5224&view=rev
Author: ntrel
Date: 2010-09-13 15:03:18 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
Fix some 'possible' NULL pointer dereferences (based on patch by
Erik de Castro Lopo).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
trunk/src/tools.c
trunk/tagmanager/python.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-09-13 14:39:32 UTC (rev 5223)
+++ trunk/ChangeLog 2010-09-13 15:03:18 UTC (rev 5224)
@@ -5,6 +5,9 @@
Find Document Usage because Find Usage can be used instead.
Go to Tag Declaration because Go to Tag Definition is more common.
Go to Line because the toolbar item can be used instead.
+ * src/tools.c, src/search.c, tagmanager/python.c:
+ Fix some 'possible' NULL pointer dereferences (based on patch by
+ Erik de Castro Lopo).
2010-09-09 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2010-09-13 14:39:32 UTC (rev 5223)
+++ trunk/src/search.c 2010-09-13 15:03:18 UTC (rev 5224)
@@ -1505,7 +1505,7 @@
* Returns NULL if no files were found, otherwise returned vector should be fully freed. */
static gchar **search_get_argv(const gchar **argv_prefix, const gchar *dir)
{
- guint prefix_len, list_len, i, j;
+ guint prefix_len, list_len, i;
gchar **argv;
GSList *list, *item;
GError *error = NULL;
@@ -1520,21 +1520,18 @@
g_error_free(error);
return NULL;
}
- if (list == NULL) return NULL;
+ if (list == NULL)
+ return NULL;
argv = g_new(gchar*, prefix_len + list_len + 1);
for (i = 0; i < prefix_len; i++)
argv[i] = g_strdup(argv_prefix[i]);
- item = list;
- for (j = 0; j < list_len; j++)
- {
+ foreach_slist(item, list)
argv[i++] = item->data;
- item = g_slist_next(item);
- }
- argv[i] = NULL;
+ argv[i] = NULL;
g_slist_free(list);
return argv;
}
Modified: trunk/src/tools.c
===================================================================
--- trunk/src/tools.c 2010-09-13 14:39:32 UTC (rev 5223)
+++ trunk/src/tools.c 2010-09-13 15:03:18 UTC (rev 5224)
@@ -452,6 +452,7 @@
case 0: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD1; break;
case 1: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD2; break;
case 2: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD3; break;
+ default: return;
}
if (key_idx != -1)
Modified: trunk/tagmanager/python.c
===================================================================
--- trunk/tagmanager/python.c 2010-09-13 14:39:32 UTC (rev 5223)
+++ trunk/tagmanager/python.c 2010-09-13 15:03:18 UTC (rev 5224)
@@ -411,9 +411,9 @@
{
n = nls->levels + i;
/* is there a better way to compare two vStrings? */
- if (strcmp(vStringValue(parent), vStringValue(n->name)) == 0)
+ if (n && strcmp(vStringValue(parent), vStringValue(n->name)) == 0)
{
- if (n && indent <= n->indentation)
+ if (indent <= n->indentation)
{
/* remove this level by clearing its name */
vStringClear(n->name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5222
http://geany.svn.sourceforge.net/geany/?rev=5222&view=rev
Author: ntrel
Date: 2010-09-09 17:31:27 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
Show Save As when saving if the document filename doesn't have an
absolute path, so command-line new files can be saved without a
prompt, but file templates still prompt the user.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-09-09 17:21:05 UTC (rev 5221)
+++ trunk/ChangeLog 2010-09-09 17:31:27 UTC (rev 5222)
@@ -17,6 +17,10 @@
* src/highlighting.c, src/encodings.c, tagmanager/tm_file_entry.c:
Remove NULL checks when calling g_free() (patch Erik de Castro
Lopo, thanks).
+ * src/document.c:
+ Show Save As when saving if the document filename doesn't have an
+ absolute path, so command-line new files can be saved without a
+ prompt, but file templates still prompt the user.
2010-09-09 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2010-09-09 17:21:05 UTC (rev 5221)
+++ trunk/src/document.c 2010-09-09 17:31:27 UTC (rev 5222)
@@ -1563,13 +1563,15 @@
}
-/* Return TRUE if the document hasn't been saved before, i.e. either the filename or
- * the real_path is not set. */
+/* Return TRUE if the document doesn't have a full filename set.
+ * This makes filenames without a path show the save as dialog, e.g. for file templates.
+ * Otherwise just use the set filename instead of asking the user - e.g. for command-line
+ * new files. */
gboolean document_need_save_as(GeanyDocument *doc)
{
g_return_val_if_fail(doc != NULL, FALSE);
- return (doc->file_name == NULL || doc->real_path == NULL);
+ return (doc->file_name == NULL || !g_path_is_absolute(doc->file_name));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.