From 23302dbd1df23021614ebe256908b87647532e4c Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 8 Oct 2023 13:07:21 +0200 Subject: [PATCH] Do not add again the /e argument to Japanese queries The /e argument should not be added if it has already been provided by the user. Closes: #1050171 --- whois.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/whois.c b/whois.c index df14478..8d93c21 100644 --- a/whois.c +++ b/whois.c @@ -742,8 +742,12 @@ char *queryformat(const char *server, const char *flags, const char *query) /* ask for english text */ if (!isripe && (streq(server, "whois.nic.ad.jp") || - streq(server, "whois.jprs.jp")) && japanese_locale()) - strcat(buf, "/e"); + streq(server, "whois.jprs.jp")) && japanese_locale()) { + /* but not if the user already added the /e flag */ + char *flag = buf + strlen(buf) - 2; + if (!streq(flag, "/e")) + strcat(buf, "/e"); + } return buf; }