From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-047.btinternet.com (mailomta30-sa.btinternet.com [213.120.69.36]) by sourceware.org (Postfix) with ESMTPS id 72BC03858D20 for ; Fri, 29 Mar 2024 16:32:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 72BC03858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 72BC03858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=213.120.69.36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711729959; cv=none; b=w2KQJrDPtg5M7ADweNEpGm1zoV24EUM1egBO1TJWB31km0VhBlPsP6UXfkZYl1PuSGHNrehdpl3McYokhZ6uE8OqeeD47AZbvX54HXD39Jg8sgUbtaeLkQx6W2vt4m+fVprAxPkR32kznrtMKXWEdsSsmglHtj6/DpwwlRxBCPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711729959; c=relaxed/simple; bh=4s+LJk59vbeZEld9I+JcI35IQ+UpbvNVFhkOdsFqr74=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=xaxqQL9ebYVBCN0aLWpHhwcGiFriC3C2N4SOhBEY9SMKU6iPsP/BqNS9b8rZXCYs5gSXIP4bSC7rtiGC4UC++pybiVJpZIgFOdy/IqSPxjBif4fE64FrZn4S6Bb+LsX5yenH99wJ03cmwlSsqHw1dotGgwAHW0JEYiNUVv1vK3w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7]) by sa-prd-fep-047.btinternet.com with ESMTP id <20240329163233.LTMI9056.sa-prd-fep-047.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 29 Mar 2024 16:32:33 +0000 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 65A566C2089FD461 X-Originating-IP: [86.140.193.25] X-OWM-Source-IP: 86.140.193.25 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledruddvvddgledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepkfffgggfuffvfhfhvegjtgfgsehtkeertddtvdejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeffheeljeevgeeigeelgeettdehffekueethffghfevledvheejudevfeffvefgieenucffohhmrghinheptgihghifihhnrdgtohhmnecukfhppeekiedrudegtddrudelfedrvdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddutdelngdpihhnvghtpeekiedrudegtddrudelfedrvdehpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopegthihgfihinhdqrghpphhssegthihgfihinhdrtghomhdprhgtphhtthhopehqugiihhgrohhvsehqqhdrtghomhdprhgvvhfkrfephhhoshhtkeeiqddugedtqdduleefqddvhedrrhgrnhhgvgekiedqudegtddrsghttggvnhhtrhgrlhhplhhushdrtghomhdprghuthhhpghushgvrhepjhhonhhtuhhrnhgvhiessghtihhnthgvrhhnvghtrdgtohhmpdhgvgho kffrpefiuedpoffvtefjohhsthepshgrqdhprhguqdhrghhouhhtqddttdeg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.109] (86.140.193.25) by sa-prd-rgout-004.btmx-prd.synchronoss.net (authenticated as jonturney@btinternet.com) id 65A566C2089FD461; Fri, 29 Mar 2024 16:32:33 +0000 Message-ID: Date: Fri, 29 Mar 2024 16:32:31 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH setup] Fix Chinese Help Message fall in dead loop . To: =?UTF-8?B?6LW15Lyf?= References: From: Jon Turney Content-Language: en-US Cc: cygwin-apps@cygwin.com In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_EXEURI,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,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: On 29/03/2024 01:40, 赵伟 via Cygwin-apps wrote: > --- > libgetopt++/include/getopt++/DefaultFormatter.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libgetopt++/include/getopt++/DefaultFormatter.h b/libgetopt++/include/getopt++/DefaultFormatter.h > index ee2397f5..43c253a5 100644 > --- a/libgetopt++/include/getopt++/DefaultFormatter.h > +++ b/libgetopt++/include/getopt++/DefaultFormatter.h > @@ -64,6 +64,7 @@ class DefaultFormatter { > { > // TODO: consider using a line breaking strategy here. > int pos = helpmsg.substr(0,h_len).find_last_of(" "); > + if(!pos)break; /*In Chinese Helpmsg,may has no space,so pos ==0,and code will fall in dead loop here*/ > theStream << helpmsg.substr(0,pos) > << std::endl << std::string (o_len, ' '); > helpmsg.erase (0,pos+1); > -- > 2.43.0 Thanks very much for bug report, and the patch! Did you actually try this? When I tested this it didn't help, as std::string::substr() returns std::string::npos (numerically, -1), not 0 when it cannot find a match. So, I applied a slightly modified version of the patch. Please try https://cygwin.com/setup/setup-2.931-1-g0ee13c.x86_64.exe