#include "ui_utildlg.h" /* for locale warning dialog */
#include "md5-util.h"
+#include "filefilter.h"
+#include "secure_save.h"
+
/*
*-----------------------------------------------------------------------------
* generic file information and manipulation routines (public)
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);
}
name = filename_from_path(path);
if (!name) return NULL;
- ext = extension_from_path(name);
+ ext = registered_extension_from_path(name);
if (!ext)
{
gchar *remove_level_from_path(const gchar *path)
{
- gint p = 0, n = -1;
+ const gchar *base;
if (!path) return NULL;
- while (path[p])
- {
- if (path[p] == G_DIR_SEPARATOR) n = p;
- p++;
- }
- if (n <= 0) n++;
-
- return g_strndup(path, (gsize) n);
-}
+ base = strrchr(path, G_DIR_SEPARATOR);
+ if (base) return g_strndup(path, strlen(path)-strlen(base));
-const gchar *extension_from_path(const gchar *path)
-{
- if (!path) return NULL;
- return strrchr(path, '.');
+ return NULL;
}
gboolean file_extension_match(const gchar *path, const gchar *ext)
gchar *remove_extension_from_path(const gchar *path)
{
- gint p = 0, n = -1;
+ const gchar *reg_ext;
if (!path) return NULL;
- while (path[p])
- {
- if (path[p] == '.') n = p;
- p++;
- }
- if (n < 0) n = p;
+ reg_ext = registered_extension_from_path(path);
- return g_strndup(path, (gsize) n);
+ return g_strndup(path, strlen(path) - (reg_ext == NULL ? 0 : strlen(reg_ext)));
}
void parse_out_relatives(gchar *path)