From 58ef37b6db7851ddcade1091882ef174aebc69c0 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 14 Mar 2020 01:43:32 -0400 Subject: Rename PACKAGE_MIN_DELIM and move it to package.h --- include/package.h | 1 + src/manifest.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/package.h b/include/package.h index 0db73d3..e8fbeec 100644 --- a/include/package.h +++ b/include/package.h @@ -1,6 +1,7 @@ #ifndef SPM_PACKAGE_H #define SPM_PACKAGE_H +#define SPM_PACKAGE_MIN_DELIM 2 #define SPM_PACKAGE_EXTENSION ".tar.gz" #define SPM_PACKAGE_MEMBER_SIZE 0xff #define SPM_PACKAGE_MEMBER_ORIGIN_SIZE PATH_MAX diff --git a/src/manifest.c b/src/manifest.c index cc45346..1b2b600 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -4,7 +4,6 @@ #include "spm.h" #include #include "url.h" -#define PACKAGE_MIN_DELIM 2 /** * Compare `ManifestPackage` packages (lazily) @@ -25,7 +24,7 @@ int manifest_package_cmp(ManifestPackage *a, ManifestPackage *b) { void manifest_package_separator_swap(char **name) { // Replace unwanted separators in the package name with placeholder to prevent splitting on the wrong one - int delim_count = num_chars((*name), SPM_PACKAGE_MEMBER_SEPARATOR) - PACKAGE_MIN_DELIM; + int delim_count = num_chars((*name), SPM_PACKAGE_MEMBER_SEPARATOR) - SPM_PACKAGE_MIN_DELIM; if (delim_count < 0) { return; -- cgit