summaryrefslogtreecommitdiffstats
path: root/src/split
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:08 +0000
commit44cf9c6d2d274eac37502e835155f7e985f1b8e6 (patch)
tree9576ba968924c5b9a55ba9e14f4f26184c62c7d4 /src/split
parentAdding upstream version 1.22.6. (diff)
downloaddpkg-upstream/1.22.7.tar.xz
dpkg-upstream/1.22.7.zip
Adding upstream version 1.22.7.upstream/1.22.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/split')
-rw-r--r--src/split/main.c2
-rw-r--r--src/split/split.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/split/main.c b/src/split/main.c
index eba2333..729f1c5 100644
--- a/src/split/main.c
+++ b/src/split/main.c
@@ -26,7 +26,7 @@
#include <errno.h>
#include <limits.h>
#include <inttypes.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#include <string.h>
diff --git a/src/split/split.c b/src/split/split.c
index 771de62..d218ab7 100644
--- a/src/split/split.c
+++ b/src/split/split.c
@@ -99,7 +99,9 @@ parse_timestamp(const char *value)
errno = 0;
timestamp = strtoimax(value, &end, 10);
- if (value == end || *end || errno != 0)
+ if (value == end || *end)
+ ohshit(_("unable to parse timestamp '%.255s'"), value);
+ else if (errno != 0)
ohshite(_("unable to parse timestamp '%.255s'"), value);
return timestamp;
@@ -162,7 +164,7 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
version = versiondescribe(&pkg->available.version, vdew_nonambig);
timestamp_str = getenv("SOURCE_DATE_EPOCH");
- if (timestamp_str)
+ if (str_is_set(timestamp_str))
timestamp = parse_timestamp(timestamp_str);
else
timestamp = time(NULL);