summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 13984707..7689079b 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -1,7 +1,7 @@
/*
* trans.c
*
- * Copyright (c) 2006-2016 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-2017 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -48,7 +48,7 @@
*/
/** Initialize the transaction. */
-int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags)
+int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, int flags)
{
alpm_trans_t *trans;
@@ -305,6 +305,7 @@ void _alpm_trans_free(alpm_trans_t *trans)
static int grep(const char *fn, const char *needle)
{
FILE *fp;
+ char *ptr;
if((fp = fopen(fn, "r")) == NULL) {
return 0;
@@ -314,6 +315,9 @@ static int grep(const char *fn, const char *needle)
if(safe_fgets(line, sizeof(line), fp) == NULL) {
continue;
}
+ if((ptr = strchr(line, '#')) != NULL) {
+ *ptr = '\0';
+ }
/* TODO: this will not work if the search string
* ends up being split across line reads */
if(strstr(line, needle)) {
@@ -415,7 +419,7 @@ cleanup:
return retval;
}
-alpm_transflag_t SYMEXPORT alpm_trans_get_flags(alpm_handle_t *handle)
+int SYMEXPORT alpm_trans_get_flags(alpm_handle_t *handle)
{
/* Sanity checks */
CHECK_HANDLE(handle, return -1);