summaryrefslogtreecommitdiff
path: root/lib/backend
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-16 14:08:28 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-16 15:47:11 +0300
commit8b9d37302588d07e1a66f66c9b5dc84625aae061 (patch)
treeba4f74d041af4fca4218939f6db0fead4598c031 /lib/backend
parent6b11f58c764d2ec5edd13987bbb61d2a0c96c7ed (diff)
downloadrpm-8b9d37302588d07e1a66f66c9b5dc84625aae061.tar.gz
rpm-8b9d37302588d07e1a66f66c9b5dc84625aae061.tar.bz2
rpm-8b9d37302588d07e1a66f66c9b5dc84625aae061.zip
There's a function to test string equivalence...
Diffstat (limited to 'lib/backend')
-rw-r--r--lib/backend/db3.c6
-rw-r--r--lib/backend/sqlite.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index db4ff14fc..602ec1a18 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -195,7 +195,7 @@ static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
char * tmpdir;
root = (dbi->dbi_root ? dbi->dbi_root : rpmdb->db_root);
- if ((root[0] == '/' && root[1] == '\0') || rpmdb->db_chrootDone)
+ if (rstreq(root, "/") || rpmdb->db_chrootDone)
root = NULL;
tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
xx = dbenv->set_tmp_dir(dbenv, tmpdir);
@@ -464,7 +464,7 @@ static int db3close(dbiIndex dbi, unsigned int flags)
* Get the prefix/root component and directory path.
*/
root = (dbi->dbi_root ? dbi->dbi_root : rpmdb->db_root);
- if ((root[0] == '/' && root[1] == '\0') || rpmdb->db_chrootDone)
+ if (rstreq(root, "/") || rpmdb->db_chrootDone)
root = NULL;
home = (dbi->dbi_home ? dbi->dbi_home : rpmdb->db_home);
@@ -596,7 +596,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
* Get the prefix/root component and directory path.
*/
root = (dbi->dbi_root ? dbi->dbi_root : rpmdb->db_root);
- if ((root[0] == '/' && root[1] == '\0') || rpmdb->db_chrootDone)
+ if (rstreq(root, "/") || rpmdb->db_chrootDone)
root = NULL;
home = (dbi->dbi_home ? dbi->dbi_home : rpmdb->db_home);
diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c
index a47c56915..d5af844ef 100644
--- a/lib/backend/sqlite.c
+++ b/lib/backend/sqlite.c
@@ -102,7 +102,7 @@ static void enterChroot(dbiIndex dbi)
{
int xx;
- if ((dbi->dbi_root[0] == '/' && dbi->dbi_root[1] == '\0') || dbi->dbi_rpmdb->db_chrootDone || sqlInRoot)
+ if (rstreq(dbi->dbi_root, "/") || dbi->dbi_rpmdb->db_chrootDone || sqlInRoot)
/* Nothing to do, was not already in chroot */
return;
@@ -120,7 +120,7 @@ static void leaveChroot(dbiIndex dbi)
{
int xx;
- if ((dbi->dbi_root[0] == '/' && dbi->dbi_root[1] == '\0') || dbi->dbi_rpmdb->db_chrootDone || !sqlInRoot)
+ if (rstreq(dbi->dbi_root, "/") || dbi->dbi_rpmdb->db_chrootDone || !sqlInRoot)
/* Nothing to do, not in chroot */
return;