From 9a98b6b066597c8c90488e1cd0fb91be1baeb636 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 31 Jan 2007 08:00:50 +0000 Subject: * Make -Qo work on multiple files again * no real sense in query_fileowner returning an int --- src/pacman/query.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/pacman/query.c b/src/pacman/query.c index 1b47a9b0..be7ca837 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -39,7 +39,7 @@ extern config_t *config; extern pmdb_t *db_local; -static int query_fileowner(pmdb_t *db, char *filename) +static void query_fileowner(pmdb_t *db, char *filename) { struct stat buf; int gotcha = 0; @@ -47,16 +47,16 @@ static int query_fileowner(pmdb_t *db, char *filename) alpm_list_t *i, *j; if(db == NULL) { - return(0); + return; } if(filename == NULL || strlen(filename) == 0) { ERR(NL, _("no file was specified for --owns\n")); - return(1); + return; } if(stat(filename, &buf) == -1 || S_ISDIR(buf.st_mode) || realpath(filename, rpath) == NULL) { - ERR(NL, _("%s is not a file.\n"), filename); - return(1); + /* fail silently if we're a directory */ + return; } for(i = alpm_db_getpkgcache(db); i && !gotcha; i = alpm_list_next(i)) { @@ -76,10 +76,7 @@ static int query_fileowner(pmdb_t *db, char *filename) } if(!gotcha) { ERR(NL, _("No package owns %s\n"), filename); - return(1); } - - return(0); } int pacman_query(alpm_list_t *targets) @@ -195,7 +192,8 @@ int pacman_query(alpm_list_t *targets) /* determine the owner of a file */ if(config->op_q_owns) { - return(query_fileowner(db_local, package)); + query_fileowner(db_local, package); + continue; } /* find packages in the db */ -- cgit v1.2.3-70-g09d2