summaryrefslogtreecommitdiffstats
path: root/src/io.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2008-01-17 19:35:42 +0000
committerFrederic Culot <calcurse@culot.org>2008-01-17 19:35:42 +0000
commit54c2b6004102de55c8ebed7d9ce5f1ece7eeb449 (patch)
tree32c7ed579f07b957f7fe931d935585e2f49fd43e /src/io.c
parent738a3a417071bfaed53297cbefad39b996e55dfb (diff)
downloadcalcurse-54c2b6004102de55c8ebed7d9ce5f1ece7eeb449.tar.gz
calcurse-54c2b6004102de55c8ebed7d9ce5f1ece7eeb449.zip
minor improvements and bugfixes
Diffstat (limited to 'src/io.c')
-rwxr-xr-xsrc/io.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/io.c b/src/io.c
index 4cce160..ad9f445 100755
--- a/src/io.c
+++ b/src/io.c
@@ -1,4 +1,4 @@
-/* $calcurse: io.c,v 1.25 2008/01/13 12:40:45 culot Exp $ */
+/* $calcurse: io.c,v 1.26 2008/01/17 19:35:42 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -126,6 +126,7 @@ io_get_export_stream(void)
_("The file cannot be accessed, please enter another file name.");
char *press_enter =
_("Press [ENTER] to continue.");
+ int cancel;
stream = NULL;
stream_name = (char *)malloc(BUFSIZ);
@@ -136,7 +137,11 @@ io_get_export_stream(void)
while (stream == NULL) {
status_mesg(question, "");
- updatestring(win[STA].p, &stream_name, 0, 1);
+ cancel = updatestring(win[STA].p, &stream_name, 0, 1);
+ if (cancel) {
+ free(stream_name);
+ return (NULL);
+ }
stream = fopen(stream_name, "w");
if (stream == NULL) {
status_mesg(wrong_name, press_enter);
@@ -841,6 +846,9 @@ io_export_data(export_mode_t mode, conf_t *conf)
/* NOTREACHED */
}
+ if (stream == NULL)
+ return;
+
io_export_header(stream);
if (!conf->skip_progress_bar && mode == IO_EXPORT_INTERACTIVE)