[hackers] [sbase] ls: set a return error code when skipping an already visited path. || Quentin Rameau

From: <git_AT_suckless.org>
Date: Thu, 18 Feb 2016 15:17:25 +0100 (CET)

commit ac055873858cc8d46390f975bc33e36283311aac
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu Feb 18 12:46:48 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Thu Feb 18 14:17:21 2016 +0000

    ls: set a return error code when skipping an already visited path.

diff --git a/ls.c b/ls.c
index f5b3e76..5dbff37 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -333,8 +333,8 @@ ls(const char *path, const struct entry *ent, int listdir)
         } else if (S_ISDIR(ent->mode) ||
             (S_ISLNK(ent->mode) && S_ISDIR(ent->tmode))) {
                 if ((treeind = visit(ent)) < 0) {
- fprintf(stderr, "%s%s: already visited\n",
- path, ent->name);
+ ret = 1;
+ weprintf("%s%s: Already visited\n", path, ent->name);
                         return;
                 }
 
Received on Thu Feb 18 2016 - 15:17:25 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 18 2016 - 15:24:11 CET