Don't try and stat the installation root if it's the empty string.
authorJ. Ali Harlow <ali@juiblex.co.uk>
Tue, 13 Jan 2009 17:04:51 +0000 (17:04 +0000)
committerJ. Ali Harlow <ali@juiblex.co.uk>
Tue, 13 Jan 2009 17:04:51 +0000 (17:04 +0000)
librazor/rpm.c

index 7613b54..02fad33 100644 (file)
@@ -754,7 +754,7 @@ razor_rpm_install(struct razor_rpm *rpm, const char *root)
        installer.root = root;
 
        /* FIXME: Only do this before a transaction, not per rpm. */
-       if (stat(root, &buf) < 0 || !S_ISDIR(buf.st_mode)) {
+       if (*root && (stat(root, &buf) < 0 || !S_ISDIR(buf.st_mode))) {
                fprintf(stderr,
                        "root installation directory \"%s\" does not exist\n",
                        root);