aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-09-21 06:51:19 +0800
committerIain Holmes <iain@src.gnome.org>2001-09-21 06:51:19 +0800
commitc503814d7ff5b5656cf1ac92c3f51a327859f76f (patch)
tree55440a4df7fc9767adea296f4fada7e7e0ab4511 /composer
parent7863fdd24ffac4a0d6d13b10a90b220e058bb5ad (diff)
downloadgsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar.gz
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar.bz2
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar.lz
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar.xz
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.tar.zst
gsoc2013-evolution-c503814d7ff5b5656cf1ac92c3f51a327859f76f.zip
Create nonexistant files.
svn path=/trunk/; revision=13021
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer.c14
2 files changed, 8 insertions, 12 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 2676296f12..146ee4f73b 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2001-09-20 Iain Holmes <iain@ximian.com>
+
+ * e-msg-composer.c (get_file_content): Open the file with O_CREAT so
+ that if it doesn't exist, it's created. Never return a NULL as this
+ could potentially crash on Solaris.
+
2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer.c (build_message): Attach an X-Evolution-Format
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 4135164ed2..860e1dc1a7 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -666,17 +666,7 @@ get_file_content (const gchar *file_name, gboolean convert, guint flags)
char *raw;
char *html;
- fd = open (file_name, O_RDONLY);
- if (fd == -1) {
- char *msg;
-
- msg = g_strdup_printf (_("Could not open file %s:\n"
- "%s"), file_name, g_strerror (errno));
-
- gnome_error_dialog (msg);
- g_free (msg);
- return NULL;
- }
+ fd = open (file_name, O_RDONLY | O_CREAT, 0775);
raw = read_file_content (fd);
@@ -689,7 +679,7 @@ get_file_content (const gchar *file_name, gboolean convert, guint flags)
gnome_error_dialog (msg);
g_free (msg);
close (fd);
- return NULL;
+ return g_strdup ("");
}
close (fd);