[Pkg-privacy-commits] [libgsecuredelete] 56/168: Fix deletion of empty directories
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 20:06:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch master
in repository libgsecuredelete.
commit 6b3c72d85ac3c6a287b1e12d3e4a68a3d1e7e5e3
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Fri Feb 26 02:06:18 2010 +0100
Fix deletion of empty directories
Deletion of empty directories was broken since there was 0 files to
delete. Don't count the actual files to know whether we have to do
some work, but just whether we have input.
---
gsecuredelete/delete-operation.vala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gsecuredelete/delete-operation.vala b/gsecuredelete/delete-operation.vala
index 2877277..31137d3 100644
--- a/gsecuredelete/delete-operation.vala
+++ b/gsecuredelete/delete-operation.vala
@@ -126,6 +126,7 @@ namespace Gsd
throws AsyncOperationError
{
List<string> args = null;
+ bool have_files = false;
args.append ("-rv");
this.add_fast_argument (ref args);
@@ -135,9 +136,12 @@ namespace Gsd
foreach (unowned string path in this._paths) {
args.append (path);
this.n_files += this.count_files (path);
+ have_files = true;
}
- if (this.n_files == 0) {
+ /* we can't use the number of files since it is 0 if there is only
+ * directories */
+ if (! have_files) {
throw new AsyncOperationError.ARGS_ERROR ("Nothing to remove");
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libgsecuredelete.git
More information about the Pkg-privacy-commits
mailing list