[gnome-commander/bugfix/crash_on_right_click_on_file] When a script in the script dir does not contain a name, use the filename in the popup menu, fixing
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/bugfix/crash_on_right_click_on_file] When a script in the script dir does not contain a name, use the filename in the popup menu, fixing
- Date: Wed, 17 Nov 2021 21:59:45 +0000 (UTC)
commit 0714ffa9ba81a615277c8e229ee63904e6b64485
Author: Uwe Scholz <u scholz83 gmx de>
Date: Wed Nov 17 22:58:10 2021 +0100
When a script in the script dir does not contain a name, use the filename in the popup menu, fixing #108
NEWS | 2 +-
doc/C/releases.xml | 2 +-
src/gnome-cmd-file-popmenu.cc | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index bc4b714d..13226eea 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ New features:
* ...
Bug fixes:
- * ...
+ * Fixed issue #108 (Crash after right click on file)
New or updated translations:
* ...
diff --git a/doc/C/releases.xml b/doc/C/releases.xml
index faaf397c..a235d634 100644
--- a/doc/C/releases.xml
+++ b/doc/C/releases.xml
@@ -30,7 +30,7 @@
<para>
<itemizedlist>
<listitem>
- <para>...</para>
+ <para>Fixed issue #108 (Crash after right click on file)</para>
</listitem>
</itemizedlist>
</para>
diff --git a/src/gnome-cmd-file-popmenu.cc b/src/gnome-cmd-file-popmenu.cc
index f6a9b3f9..8a72e91e 100644
--- a/src/gnome-cmd-file-popmenu.cc
+++ b/src/gnome-cmd-file-popmenu.cc
@@ -583,6 +583,7 @@ guint add_action_script_entries(GtkUIManager *uiManager, GList *files)
scriptPath.append ("/").append ((char*) scriptFileName->data);
scriptData->path = g_strdup (scriptPath.c_str());
+ // Try to get the scriptname out of the script, otherwise take the filename
char *scriptName = nullptr;
FILE *fileStream = fopen (scriptData->path, "r");
if (fileStream)
@@ -603,6 +604,7 @@ guint add_action_script_entries(GtkUIManager *uiManager, GList *files)
}
fclose (fileStream);
}
+ scriptName = scriptName ? scriptName : g_strdup((char*) scriptFileName->data);
auto dynAction = gtk_action_new (scriptName, scriptName, nullptr, GTK_STOCK_EXECUTE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]