changeset 309:99139bf9f380

Use path_from_utf8() on the passed filename. Add const attribute.
author zas_
date Fri, 11 Apr 2008 14:27:55 +0000
parents 6cb3c072be3f
children 4b25b3b30f35
files src/secure_save.c src/secure_save.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/secure_save.c	Fri Apr 11 13:07:48 2008 +0000
+++ b/src/secure_save.c	Fri Apr 11 14:27:55 2008 +0000
@@ -15,6 +15,7 @@
 #include "main.h"
 #include "secure_save.h"
 
+#include "ui_fileops.h"
 
 /* ABOUT SECURE SAVE */
 /* This code was borrowed from the ELinks project (http://elinks.cz)
@@ -68,7 +69,7 @@
 /** Open a file for writing in a secure way. @returns a pointer to a
  * structure secure_save_info on success, or NULL on failure. */
 static SecureSaveInfo *
-secure_open_umask(gchar *file_name)
+secure_open_umask(const gchar *file_name)
 {
 	struct stat st;
 	SecureSaveInfo *ssi;
@@ -83,7 +84,7 @@
 
 	ssi->secure_save = TRUE;
 
-	ssi->file_name = g_strdup(file_name);
+	ssi->file_name = path_from_utf8(file_name);
 	if (!ssi->file_name) {
 		secsave_errno = SS_ERR_OUT_OF_MEM;
 		goto free_f;
@@ -187,7 +188,7 @@
 }
 
 SecureSaveInfo *
-secure_open(gchar *file_name)
+secure_open(const gchar *file_name)
 {
 	SecureSaveInfo *ssi;
 	mode_t saved_mask;
--- a/src/secure_save.h	Fri Apr 11 13:07:48 2008 +0000
+++ b/src/secure_save.h	Fri Apr 11 14:27:55 2008 +0000
@@ -14,7 +14,7 @@
 
 extern SecureSaveErrno secsave_errno; /**< internal secsave error number */
 
-SecureSaveInfo *secure_open(gchar *);
+SecureSaveInfo *secure_open(const gchar *);
 
 gint secure_close(SecureSaveInfo *);