From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id E3E9F383FBAA for ; Thu, 20 Oct 2022 18:27:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3E9F383FBAA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x536.google.com with SMTP id q1so275574pgl.11 for ; Thu, 20 Oct 2022 11:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=66jzVvq3ZN+7lbp8CwAHNGRtXnz45vh1DN2S11XRPdU=; b=V/lYi+XdeBmYVBsstuHKUTnPCsLa7WsrXgu9IfSiBGZZvofpEHl2jqEJyuImCHZFka FTy3x5zgV2ayBkRNo8MNL8U5yfw9YH92vz9/2ruA0zUifcZVNjvLzkp22sWQUqw0W35r spmBhCkZjck5SBtEhLG80IkQGDBb7YD9+/ArMVtzd8ygySq86sFdkpC5gL7vkxemHAKZ cIfzadvDiEe0z4KYjOVJFkPFoJTCEJRMla2nd3w+RSIxpY0HcjHGZAzXDKBlrLGsVVXb HzjYH64OjwH0NtPSp/y2BPqkfR2XIAG+0SIZnAV1LRgmnF9rbFSFfHQNpXD9YwWppQiS ujhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=66jzVvq3ZN+7lbp8CwAHNGRtXnz45vh1DN2S11XRPdU=; b=YUfXSEL78B1YOYTz+6d6JRa37zZN9+0/txmRNZxVb/YFJxoonReMaEc9Mavw18C9go ALdbjEdcjnB5nPaEo3hfu/NkmQ8D1NH4aan8DnyYXeU5f9yZBQkT35f4QZs5TSmdlTGm 5/4j03VDf+s2gJMgLGHOIwLu42MX/SLe5+f8Srzks6pMVyBHyvOXXb+tagoDM01d3D3e pggOqLZ0G3tfFSfrvxn/G51nEJbqsXL9GBNCd2kkH+TdaaV8OWGH48xIpEZ9qUuKEeNP NPEIZ+wZBW2WJIXrVUevDxU3Rzn1uHc8/vqdloAQhhsgW02LSq+2Prx02te5WqGFeTZ3 bZMw== X-Gm-Message-State: ACrzQf196R0JDV23a9LFn5e3eDP5LpnGVItkFhQFQtvHGAdX+hU0DbCl ye5jtTfv1iAA2coDjumkthPqpYLZgY2Zag== X-Google-Smtp-Source: AMsMyM7Pjv1hxk4gH/UdF+WS5XxTmC8Dqmm5SBlhOjgXRu8wyadiFKRC9IaXFovH5EbztWXpvqV9tg== X-Received: by 2002:a05:6a00:b85:b0:563:4623:ec40 with SMTP id g5-20020a056a000b8500b005634623ec40mr15164423pfj.56.1666290434506; Thu, 20 Oct 2022 11:27:14 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id w15-20020a17090a460f00b00202fbd9c21dsm115067pjg.48.2022.10.20.11.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 11:27:13 -0700 (PDT) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH 24/25] lib: isatty is not available on windows Date: Fri, 21 Oct 2022 02:26:03 +0800 Message-Id: <20221020182603.815-25-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221020182603.815-1-luoyonggang@gmail.com> References: <20221020182603.815-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Signed-off-by: Yonggang Luo --- lib/color.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/color.c b/lib/color.c index 8063dc26..963a2ec2 100644 --- a/lib/color.c +++ b/lib/color.c @@ -117,9 +117,14 @@ parse_opt (int key, char *arg, if (strcmp (arg, values[i].str) == 0) { color_mode = values[i].mode; +#ifdef _WIN32 + if (color_mode == color_auto) + color_mode = color_never; +#else if (color_mode == color_auto) color_mode = isatty (STDOUT_FILENO) ? color_always : color_never; +#endif break; } if (i == nvalues) -- 2.36.1.windows.1