[nautilus-sendto] main: Use g_mkdir_with_parents()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-sendto] main: Use g_mkdir_with_parents()
- Date: Tue, 23 Sep 2014 08:34:45 +0000 (UTC)
commit b8ee7f4055d9f9eb0cae227d20e7b02d2dd40587
Author: Bastien Nocera <hadess hadess net>
Date: Tue Sep 23 10:29:10 2014 +0200
main: Use g_mkdir_with_parents()
Instead of creating the parent directory by hand.
src/nautilus-sendto.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-sendto.c b/src/nautilus-sendto.c
index 586efee..2c14b09 100644
--- a/src/nautilus-sendto.c
+++ b/src/nautilus-sendto.c
@@ -254,21 +254,17 @@ pack_files (GList *file_list)
const char *filename;
GList *l;
GString *cmd, *tmp;
- char *pack_type, *tmp_dir, *tmp_work_dir, *packed_file;
+ char *pack_type, *tmp_work_dir, *packed_file;
file_roller_cmd = g_find_program_in_path ("file-roller");
filename = pack_filename_from_names (file_list);
g_assert (filename != NULL && *filename != '\0');
- tmp_dir = g_strdup_printf ("%s/nautilus-sendto-%s",
- g_get_tmp_dir (), g_get_user_name ());
- g_mkdir (tmp_dir, 0700);
tmp_work_dir = g_strdup_printf ("%s/nautilus-sendto-%s/%li",
g_get_tmp_dir (), g_get_user_name (),
time (NULL));
- g_mkdir (tmp_work_dir, 0700);
- g_free (tmp_dir);
+ g_mkdir_with_parents (tmp_work_dir, 0700);
pack_type = g_strdup (".zip");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]