[pacman-dev,v2,1/2] pacman/query.c: in query_fileowner, make is_dir an int

Message ID 20180124223041.3834-1-iff@escondida.tk
State Superseded, archived
Headers show
Series [pacman-dev,v2,1/2] pacman/query.c: in query_fileowner, make is_dir an int | expand

Commit Message

Ivy Foster Jan. 24, 2018, 10:30 p.m. UTC
From: Ivy Foster <iff@escondida.tk>

S_ISDIR is int and "returns non-zero" if the file is a directory.

Signed-off-by: Ivy Foster <iff@escondida.tk>
I know this is super trivial; I just noticed it while working on the
following patch, and didn't want to make an unrelated change in it.

 src/pacman/query.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/src/pacman/query.c b/src/pacman/query.c
index 4a37a338..91ca78a7 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -158,8 +158,9 @@  static int query_fileowner(alpm_list_t *targets)
 		char rpath[PATH_MAX], *rel_path;
 		struct stat buf;
 		alpm_list_t *i;
-		size_t len, is_dir;
+		size_t len;
 		unsigned int found = 0;
+		int is_dir;
 		if((filename = strdup(t->data)) == NULL) {
 			goto targcleanup;