From 488b3e3a6fe6898edd03df32ef59294fc09bb567 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 23 Mar 2022 08:50:52 +0100 Subject: [PATCH] Fix "unrealircdctl spkifp" usage info on Windows. On Linux we still show the usage info as for "unrealircd" (not unrealircdctl) since on Linux we have the "unrealircd" script that manages all this and "unrealircdctl" is not really meant to be called directly by end-users. --- src/unrealircdctl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/unrealircdctl.c b/src/unrealircdctl.c index fc1f719a7..ddb094e06 100644 --- a/src/unrealircdctl.c +++ b/src/unrealircdctl.c @@ -25,6 +25,13 @@ */ #include "unrealircd.h" +#ifdef _WIN32 + #define UNREALCMD "unrealircdctl" +#else + #define UNREALCMD "./unrealircd" +#endif + + extern int procio_client(const char *command, int auto_color_logs); void unrealircdctl_usage(const char *program_name) @@ -188,7 +195,7 @@ void unrealircdctl_spkifp(int argc, char *argv[]) { printf("NOTE: This script uses the default certificate location (any set::tls settings\n" "are ignored). If this is not what you want then specify a certificate\n" - "explicitly like this: ./unrealircd spkifp conf/tls/example.pem\n\n"); + "explicitly like this: %s spkifp conf/tls/example.pem\n\n", UNREALCMD); safe_strdup(file, "tls/server.cert.pem"); convert_to_absolute_path(&file, CONFDIR); } @@ -196,8 +203,8 @@ void unrealircdctl_spkifp(int argc, char *argv[]) if (!file_exists(file)) { printf("Could not open certificate: %s\n" - "You can specify a certificate like this: ./unrealircd spkifp conf/tls/example.pem\n", - file); + "You can specify a certificate like this: %s spkifp conf/tls/example.pem\n", + UNREALCMD, file); exit(1); }