changeset 1399:7dfa34e4de15

Fix up editor execution.
author zas_
date Sun, 08 Mar 2009 15:02:18 +0000
parents 9e7aed6ba6bd
children 67573155210c
files src/editors.c
diffstat 1 files changed, 23 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/editors.c	Sun Mar 08 14:27:19 2009 +0000
+++ b/src/editors.c	Sun Mar 08 15:02:18 2009 +0000
@@ -688,28 +688,30 @@
 						flags |= EDITOR_ERROR_INCOMPATIBLE;
 						goto err;
 						}
-					/* use the first file from the list */
-					if (!list || !list->data)
-						{
-						flags |= EDITOR_ERROR_NO_FILE;
-						goto err;
-						}
-					pathl = editor_command_path_parse((FileData *)list->data,
-									  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
-									  editor);
-					if (!pathl)
+					if (list)
 						{
-						flags |= EDITOR_ERROR_NO_FILE;
-						goto err;
+						/* use the first file from the list */
+						if (!list->data)
+							{
+							flags |= EDITOR_ERROR_NO_FILE;
+							goto err;
+							}
+						pathl = editor_command_path_parse((FileData *)list->data,
+										  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
+										  editor);
+						if (!pathl)
+							{
+							flags |= EDITOR_ERROR_NO_FILE;
+							goto err;
+							}
+						if (output)
+							{
+							result = g_string_append_c(result, '"');
+							result = g_string_append(result, pathl);
+							result = g_string_append_c(result, '"');
+							}
+						g_free(pathl);
 						}
-					if (output)
-						{
-						result = g_string_append_c(result, '"');
-						result = g_string_append(result, pathl);
-						result = g_string_append_c(result, '"');
-						}
-					g_free(pathl);
-
 					break;
 
 				case 'F':
@@ -721,6 +723,7 @@
 						goto err;
 						}
 
+					if (list)
 						{
 						/* use whole list */
 						GList *work = list;