[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH febootstrap 2/2] helper: Ignore editor backup (*~) files.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
>From 7d7d6e5814475dc4f97f9af8965462c8865e1ae1 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Fri, 27 Aug 2010 17:04:53 +0100
Subject: [PATCH 2/2] helper: Ignore editor backup (*~) files.

---
 helper/appliance.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/helper/appliance.c b/helper/appliance.c
index e014b12..85efd75 100644
--- a/helper/appliance.c
+++ b/helper/appliance.c
@@ -144,6 +144,11 @@ iterate_input_directory (const char *dirname, int dirfd, struct writer *writer)
     if (d->d_name[0] == '.') /* ignore ., .. and any hidden files. */
       continue;
 
+    /* Ignore *~ files created by editors. */
+    size_t len = strlen (d->d_name);
+    if (len > 0 && d->d_name[len-1] == '~')
+      continue;
+
     add_string (&entries, &nr_entries, &nr_alloc, d->d_name);
   }
 
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]