Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set: * Added strlcat() and strlcpy() from OpenBSD, always use them if the system does not have them built in. * Changed an array of PATH_MAX size allocated in the stack, to a dynamically allocated buffer from heap. This should reduce memory usage a bit. * Simplify code that implemented a homegrown realpath(3) implementation, simply use realpath(3). * If compiler supports -fstack-protector, build all code with -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all buffers are protected.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/vars.mk
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
BIN = xbps-uhelper
|
||||
|
||||
|
@@ -102,9 +102,9 @@ main(int argc, char **argv)
|
||||
{
|
||||
prop_dictionary_t dict;
|
||||
const char *version;
|
||||
char *plist, *pkgname, *pkgver, *in_chroot_env, *root = "";
|
||||
char *plist, *pkgname, *pkgver, *in_chroot_env, *root = "", *hash;
|
||||
bool in_chroot = false;
|
||||
int c, rv = 0;
|
||||
int i, c, rv = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "Var:")) != -1) {
|
||||
switch (c) {
|
||||
@@ -299,9 +299,6 @@ main(int argc, char **argv)
|
||||
if (argc < 2)
|
||||
usage();
|
||||
|
||||
char *hash;
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
hash = xbps_get_file_hash(argv[i]);
|
||||
if (hash == NULL) {
|
||||
@@ -320,7 +317,6 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
|
||||
xbps_fetch_set_cache_connection(0, 0);
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
rv = xbps_fetch_file(argv[i], ".", false, "v");
|
||||
|
Reference in New Issue
Block a user