[file-roller] escape new lines in filenames when saving the file list to a file
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] escape new lines in filenames when saving the file list to a file
- Date: Tue, 6 Jul 2010 07:33:15 +0000 (UTC)
commit a11fb9423171754648773779a9fbfb1dbaad3cef
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jul 6 09:31:15 2010 +0200
escape new lines in filenames when saving the file list to a file
src/fr-archive.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/fr-archive.c b/src/fr-archive.c
index adf9976..fdbc06c 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -1489,12 +1489,17 @@ save_list_to_temp_file (GList *file_list,
for (scan = file_list; scan != NULL; scan = scan->next) {
char *filename = scan->data;
+ filename = str_substitute (filename, "\n", "\\n");
if ((g_output_stream_write (G_OUTPUT_STREAM (ostream), filename, strlen (filename), NULL, error) < 0)
|| (g_output_stream_write (G_OUTPUT_STREAM (ostream), "\n", 1, NULL, error) < 0))
{
error_occurred = TRUE;
- break;
}
+
+ g_free (filename);
+
+ if (error_occurred)
+ break;
}
if (! error_occurred && ! g_output_stream_close (G_OUTPUT_STREAM (ostream), NULL, error))
error_occurred = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]