diff --git a/.github/workflows/alpinelinux.yml b/.github/workflows/alpinelinux.yml index 365835d..971a483 100644 --- a/.github/workflows/alpinelinux.yml +++ b/.github/workflows/alpinelinux.yml @@ -2,9 +2,9 @@ name: alpinelinux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: alpinelinux: diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index 63f98f0..ccd179a 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -2,9 +2,9 @@ name: archlinux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: archlinux: diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 2466117..5be63bc 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -2,9 +2,9 @@ name: CentOS Linux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: centos8: diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index 56ac05b..7e66e4a 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -2,9 +2,9 @@ name: codacy-analysis on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: codacy-analysis: diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 8e760b3..00c8394 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -2,9 +2,9 @@ name: Debian GNU/Linux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: test: diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 0896dfd..67ddfaa 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -2,9 +2,9 @@ name: Fedora on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: test: diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 5c0f606..8652cb6 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -2,9 +2,9 @@ name: FreeBSD on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: freebsd: diff --git a/.github/workflows/gentoo.yml b/.github/workflows/gentoo.yml index 30ad08e..aea7a5e 100644 --- a/.github/workflows/gentoo.yml +++ b/.github/workflows/gentoo.yml @@ -2,9 +2,9 @@ name: gentoo on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: gentoo: diff --git a/.github/workflows/linuxmint.yml b/.github/workflows/linuxmint.yml index 7140749..c67b574 100644 --- a/.github/workflows/linuxmint.yml +++ b/.github/workflows/linuxmint.yml @@ -2,9 +2,9 @@ name: LinuxMint on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: test: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ef6a5e6..0ca6b63 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,9 +2,9 @@ name: macos on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: diff --git a/.github/workflows/manjaro.yml b/.github/workflows/manjaro.yml index 0a27df2..833ef74 100644 --- a/.github/workflows/manjaro.yml +++ b/.github/workflows/manjaro.yml @@ -2,9 +2,9 @@ name: Manjaro Linux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: test: diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml index 776807c..5c052d4 100644 --- a/.github/workflows/netbsd.yml +++ b/.github/workflows/netbsd.yml @@ -2,9 +2,9 @@ name: NetBSD on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: netbsd: diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml index 6c06ba4..394ce0e 100644 --- a/.github/workflows/openbsd.yml +++ b/.github/workflows/openbsd.yml @@ -2,9 +2,9 @@ name: OpenBSD on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: openbsd: diff --git a/.github/workflows/opensuse.yml b/.github/workflows/opensuse.yml index e7edb33..eec5a65 100644 --- a/.github/workflows/opensuse.yml +++ b/.github/workflows/opensuse.yml @@ -2,9 +2,9 @@ name: openSUSE on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: opensuse: diff --git a/.github/workflows/ppkg.yml b/.github/workflows/ppkg.yml index ec9de81..06f2cf7 100644 --- a/.github/workflows/ppkg.yml +++ b/.github/workflows/ppkg.yml @@ -2,9 +2,9 @@ name: ppkg on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: ppkg: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a62c01..bed00f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: 0.15.2 + ref: 0.15.3 - id: check-if-has-new-commit run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index aa62801..1c8c71b 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,9 +2,9 @@ name: ubuntu on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: vcpkg: diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 0871d4b..bf21bb5 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -2,9 +2,9 @@ name: valgrind on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: valgrind: diff --git a/.github/workflows/voidlinux.yml b/.github/workflows/voidlinux.yml index 9cca67a..c424db8 100644 --- a/.github/workflows/voidlinux.yml +++ b/.github/workflows/voidlinux.yml @@ -2,9 +2,9 @@ name: voidlinux on: push: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] pull_request: - branches: [ 0.15.2 ] + branches: [ 0.15.3 ] jobs: voidlinux: diff --git a/CMakeLists.txt b/CMakeLists.txt index 30483d5..25136dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.0) project(uppm C) -set(PROJECT_VERSION 0.15.2) +set(PROJECT_VERSION 0.15.3) set(PROJECT_VERSION_MAJOR 0) set(PROJECT_VERSION_MINOR 15) -set(PROJECT_VERSION_PATCH 2) +set(PROJECT_VERSION_PATCH 3) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/src/core/tar.c b/src/core/tar.c index d3faa83..f098caa 100644 --- a/src/core/tar.c +++ b/src/core/tar.c @@ -44,7 +44,13 @@ int tar_list(const char * inputFilePath, int flags) { finalize: if (ret != ARCHIVE_OK) { - fprintf(stdout, "%s\n", archive_error_string(ar)); + const char * errorMessage = archive_error_string(ar); + + if (errorMessage == NULL || errorMessage[0] == '\0') { + fprintf(stderr, "unknown error.\n"); + } else { + fprintf(stderr, "%s\n", errorMessage); + } } archive_read_close(ar); @@ -97,11 +103,9 @@ int tar_extract(const char * outputDir, const char * inputFilePath, int flags, b const char * entry_pathname = archive_entry_pathname(entry); if (stripComponentsNumber > 0U) { - size_t entry_pathname_length = strlen(entry_pathname); - - for (size_t i = 0; i < entry_pathname_length; i++) { + for (size_t i = 0; entry_pathname[i] != '\0'; i++) { if (entry_pathname[i] == '/') { - entry_pathname = entry_pathname + i + 1U; + entry_pathname += i + 1U; break; } } @@ -131,10 +135,9 @@ int tar_extract(const char * outputDir, const char * inputFilePath, int flags, b if (hardlinkname != NULL) { if (stripComponentsNumber > 0U) { - size_t hardlinkname_length = strlen(hardlinkname); - for (size_t i = 0; i < hardlinkname_length; i++) { + for (size_t i = 0; hardlinkname[i] != '\0'; i++) { if (hardlinkname[i] == '/') { - hardlinkname = hardlinkname + i + 1U; + hardlinkname += i + 1U; break; } } @@ -194,7 +197,15 @@ int tar_extract(const char * outputDir, const char * inputFilePath, int flags, b finalize: if (ret != ARCHIVE_OK) { - fprintf(stdout, "%s\n", archive_error_string(ar)); + const char * errorMessage = archive_error_string(ar); + + if (errorMessage == NULL || errorMessage[0] == '\0') { + fprintf(stderr, "unknown error.\n"); + } else { + fprintf(stderr, "%s\n", errorMessage); + } + + fprintf(stderr, "%s\n", errorMessage); } archive_read_close(ar); @@ -427,7 +438,14 @@ int tar_create(const char * inputDir, const char * outputFilePath, ArchiveType t finalize: if (ret != ARCHIVE_OK) { - fprintf(stdout, "%s\n", archive_error_string(ar)); + const char * errorMessage = archive_error_string(ar); + + if (errorMessage == NULL || errorMessage[0] == '\0') { + fprintf(stderr, "unknown error.\n"); + } else { + fprintf(stderr, "%s\n", errorMessage); + } + archive_read_close(ar); archive_read_free(ar); }