From e4ba5f540b9c7ee7ef92a7013ada72fbdce3db89 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 7 Apr 2021 09:44:22 -0400 Subject: [PATCH] Report an error when the test file cannot be found. --- CHANGES.md | 4 +++- tools/ipptool.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9bebc1b7e6..16576f7371 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,9 @@ CUPS v2.4rc1 (Pending) - Added support for AirPrint and Mopria clients (Issue #105) - Added configure support for specifying systemd dependencies in the CUPS service file (Issue #144) +- Added several features and improvements to `ipptool` (Issue #153) +- The `ipptool` command now correctly reports an error when a test file cannot + be found. - Fixed Kerberos authentication for the web interface (Issue #19) - The ZPL sample driver now supports more "standard" label sizes (Issue #70) - The IPP backend did not return the correct status code when a job was canceled @@ -21,7 +24,6 @@ CUPS v2.4rc1 (Pending) - The USB backend now runs as root (Issue #121) - Added pkg-config file for libcups (Issue #122) - Fixed a PPD memory leak caused by emulator definitions (Issue #124) -- Added several features and improvements to `ipptool` (Issue #153) - The scheduler now includes the `[Job N]` prefix for job log messages, even when using syslog logging (Issue #154) - Added support for locales using the GB18030 character set (Issue #159) diff --git a/tools/ipptool.c b/tools/ipptool.c index 25a34d2b60..5cfdaab342 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -681,7 +681,12 @@ main(int argc, /* I - Number of command-line args */ else testfile = argv[i]; - if (!do_tests(testfile, &data)) + if (access(testfile, 0)) + { + _cupsLangPrintf(stderr, _("%s: Unable to open \"%s\": %s"), "ipptool", testfile, strerror(errno)); + status = 1; + } + else if (!do_tests(testfile, &data)) status = 1; } } -- 2.47.3