Additional debug features
[geeqie.git] / src / ui_fileops.c
index 714efc8..c4466fc 100644 (file)
@@ -42,6 +42,8 @@
 #include "md5-util.h"
 
 #include "filefilter.h"
+#include "secure_save.h"
+
 /*
  *-----------------------------------------------------------------------------
  * generic file information and manipulation routines (public)
@@ -56,6 +58,8 @@ void print_term(const gchar *text_utf8)
 
        text_l = g_locale_from_utf8(text_utf8, -1, NULL, NULL, NULL);
        fputs((text_l) ? text_l : text_utf8, stderr);
+       if(command_line && command_line->ssi)
+               secure_fputs(command_line->ssi, (text_l) ? text_l : text_utf8);
        g_free(text_l);
 }
 
@@ -757,8 +761,13 @@ gboolean file_extension_match(const gchar *path, const gchar *ext)
 
 gchar *remove_extension_from_path(const gchar *path)
 {
+       const gchar *reg_ext;
+
        if (!path) return NULL;
-       return g_strndup(path, strlen(path)-strlen(registered_extension_from_path(path)));
+
+       reg_ext = registered_extension_from_path(path);
+
+       return g_strndup(path, strlen(path) - (reg_ext == NULL ? 0 : strlen(reg_ext)));
 }
 
 void parse_out_relatives(gchar *path)