xbps-dgraph: only set rootdir it was set (fix #33).

This commit is contained in:
Juan RP committed 2014-03-10 10:20:04 +01:00
1 parent 2bb915c9d5
commit 878d2bf7e2
2 files changed
+7 -2

No files matched your search

+4 -2
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2010-2013 Juan Romero Pardines.
* Copyright (c) 2010-2014 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -479,7 +479,9 @@ main(int argc, char **argv)
/* Initialize libxbps */
memset(&xh, 0, sizeof(xh));
strncpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
if (rootdir != NULL)
strncpy(xh.rootdir, rootdir, sizeof(xh.rootdir));
if ((rv = xbps_init(&xh)) != 0)
die("failed to initialize libxbps: %s", strerror(rv));