delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/06/19/15:08:44

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71F813858281
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=cornell.edu
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cornell.edu
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=UKmaZsWjm+XCGt9a4/ri1L9nA16ecVjiRgKeHdUhCnzVSCVvHf5Xhz9Vyyf/1hXoXN60fgDxAh2S2rjs57TAbFl7viPCBtji3aooz3lXxLABkIoiC4S8nji0EtaUjvb7h2+vkjH2wS7OIMp0pOc7kL8R4pwm1x7uaf1tv4Dv+cUuHXexB296mtDwRh/IWDHlpKccHAeeDEVbdjDmSs/4v/HgdGfLTioNew6zatdiSx1R8n2Y0iTdC0hfc2hELvTc43GmACqIiqH15KzBpUd3+lg7mU0wbQDKY6gsJ5KACpiKqEapR0QEtNziHkwJm9XuejgdrMF2LocwXEOnocmBZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=I7fbKHDHG7933wsPxTdPqH3RXJaEL/suYefmNKneECc=;
b=cckvsU0AwKa+3AQsdKCUYbNrfHXv/pIkwJzrItgEnK/xg+bsx/68EYgZfoBOWpxL58ij6QZaqgCSwrDOyt0qgg9WFqiZAv6y+Aecnzy3PJy5d20KILP+lcA5s2scIXqZcm0XblEdyY7WFxnbbXZB3vNiEkfLRRkZ5//uQ7FHsT2RBD4kSVbW6ec2UDfnhAGE6mnOKwr2HBsW9t4R8urbeGy6qZoE0G1FXL1EdLODWG9hdIbtNiMDIzH9rGN5iHoRrBOzW1mx8hK70M9yausTZHiyqpKJvjtzKrPGeWcdeLIGi2ZDjKuW3/ULIF7GnarZK3mEUk8eof1hVEuVmSxRCA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=I7fbKHDHG7933wsPxTdPqH3RXJaEL/suYefmNKneECc=;
b=MOlMUyWit/9eXNTq+MksXDkar508ar7Kdw90kHcNEm49Z3b6XFkFomdUoxDG1cMOK0w8Zgc+L4yXure7LhSiCszgkmAWXaCyV0FchpXv0ElHhGjOIdh77EhnkR4icZ0NcikBjeWqOWcVngzcwOKAlyjhRIQ7zA1CYkin8S6GGLQ=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=cornell.edu;
Message-ID: <827e2006-2aae-9f7f-9c3f-eef3a7c6e793@cornell.edu>
Date: Sun, 19 Jun 2022 15:08:19 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
To: cygwin <cygwin AT cygwin DOT com>
From: Ken Brown <kbrown AT cornell DOT edu>
Subject: Bug in Control-d handling?
X-ClientProxiedBy: MN2PR04CA0020.namprd04.prod.outlook.com
(2603:10b6:208:d4::33) To BN7PR04MB4388.namprd04.prod.outlook.com
(2603:10b6:406:f8::19)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: f7515e90-f85e-452a-ae0f-08da52271337
X-MS-TrafficTypeDiagnostic: MN2PR04MB6655:EE_
X-Microsoft-Antispam-PRVS: <MN2PR04MB6655069BF26E00685EF6DDA6D8B19 AT MN2PR04MB6655 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: TZwdNiu4g+nyAcCAyopXnAzY+1mVOcGFV89A8g0J7o4NcH4+AwKsZOa5BQjQ80qk4AsTelh0/+JvLEuerbTiCBho0BFwQ+s2vvbCIo1R0kCBGxPyct/lo55Ti3KDX95TDklfJ8iMbvNf+gaz1+4c1ak50un8VTZM+U3SqHNAuoeGU/jQuEexoVJ1SHlj+OjAji9XQb+ZPLkSg4PJ3eSNqkXbC/JAYCTQH481GA1SNkAz3RDxl/h4Hw7lnA7GSZKs/CcP/RFMoYSSCIKWPdXtUmr1n5Afn7z2dZ7CB/Va80+IATekK1ak1ljFy/DZZ8XmPyxXyLr4BHb2nkFm4cOvQu4FV2sbFzcBKBOQRKMdOJLUrSr10ab4jW6TBYPyH7yC0+XgiDsHJNJHCGMq1ZMpILgHX+S016G6Kwh2ekS2z3MXHJqYZMF66fo7V/U8q/gNRTeLHHCoqG/JrzffcrFiKegyT3DXhQHTU8tsiRyUhX5y9IiWP0Gc3Kw1/epdCnh0DsefUzLWUMXTFoB3pt9ulo00bERHJvafLiWW2pyuxN2aKkc5QlkmOfmRgzov0OKNXLbZ7E+zoGaE63U58j9b/et1SF7JzxI8IGlGBCtec6Z0l2FaxRZro9DnQ6ZninJLP/nd47I83Kc1+tcMeLFFSN0iHaDgQE067Lxv9Y+bhE4rZZlAOhLVT579dlx/E/7Yq85+gOIKtDzeL24YxfGRPEbnxElwvqXKdJq+7kTdeJc=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230016)(4636009)(366004)(6512007)(31696002)(66556008)(66476007)(66946007)(86362001)(6506007)(2906002)(316002)(786003)(36756003)(38100700002)(6916009)(8676002)(31686004)(498600001)(4744005)(5660300002)(8936002)(186003)(2616005)(6486002)(3480700007)(75432002)(43740500002)(45980500001);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YW9jMFdjU3VFSWozbVBQeW92SzRDNjlzN1I0d0srNE8yck8yQ1B5bUc2Vi9Q?=
=?utf-8?B?NVVBeVUrcmNLTy9KQkh4RVZBZnZoU0tKb3FQdkFrQzlTbE9vam12Y3ZsYnNL?=
=?utf-8?B?R3gvQm53djI3anVKdWVJd1FMbVZvamIyNTlUUFpWLy9vcUV2RFBKNk4rODZH?=
=?utf-8?B?UlUyV3pYT3BaU3dubHV2czM1OGtqc0Z4OCsrejV6dVh4YXRjWGJwc2wySEhT?=
=?utf-8?B?dG5HclZIY2NTOFZ3TFZOSmJCbEFwMHZleEthMk55aHR4VGZ5YmtsblBsSWZW?=
=?utf-8?B?c2E2TklKZm1RUlhWQU53Vm4zdDZoNkNYa0ZZeEM2Tk51T3Z3TDM3K2ZtOFFq?=
=?utf-8?B?d09EcGdoMTJGZUt5TGpiRlB6YW9pditFajBZbWRPRDJWVkpoVy8wSFhxdE1Q?=
=?utf-8?B?TUNHaWhMakZEVnQ0RE8veHRPOVp5LzhrV0tsa1k3ZWE0Zjg0eXM5VGRub05L?=
=?utf-8?B?c1I0NndoUm5mTWlkamNxVWxTRDNya2JucUJJT3dIaWpIYTFGZnJBUUUyUXJE?=
=?utf-8?B?OUE3a240ZVNsRjNRTGVhS3ZTY2tOTGNFRGVCdjhwUXR2eXdRZ1RpZFE0V2I3?=
=?utf-8?B?b09CU2daazU0VEdncEdhcWVwbC8vZ2MzTVhyVzlnUVRGZldIWDZjRVVFYk5V?=
=?utf-8?B?MEVuOUpROUdIazNZY0tiMnpBUXhvMTRXdFJJNlgvMEdqS0tXY3ZZWW53T2xX?=
=?utf-8?B?WEtTZUVTMjdDdTNSZWpweUpnRWt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change-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2022 19:08:20.7214 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /nUZsxJFBqEzsMWWt2HFhuq33Zd4E9z0PFSLVIQk/loCU4Y+ZAMzMhqqFN2EfFt7jQLidGf+YOpfbPSWD6HlGg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6655
X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, SPF_HELO_PASS,
SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Consider the following program, which reads from standard input a line at a time 
and then echoes the input back to the terminal:

$ cat cat_line.c
#include <stdio.h>

int main ()
{
   char buf[BUFSIZ];

   while (fgets (buf, BUFSIZ, stdin))
     fputs (buf, stdout);
}

Run the program, type one or more characters (without hitting Enter), and type 
Ctrl-d until the program exits.  What I expect is that nothing visible happens 
on the first Ctrl-d [but the input is sent to the internal stdin buffer], and 
that the input is echoed and the program exits after the second Ctrl-d [the 
program sees EOF].  This is what happens on Linux.  On Cygwin, however, the 
program keeps running after the second Ctrl-d and doesn't exit until Ctrl-d is 
pressed a third time.

I observed this problem because of a failing Emacs test, in which the program 
"rev" was not seeing EOF after being sent Ctrl-d; "rev" does something like the 
test case above, but using fgetws instead of fgets.

Ken

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019