From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C5821222DE14C for ; Mon, 12 Feb 2018 07:17:50 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2018 07:23:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,501,1511856000"; d="scan'208";a="174189041" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 12 Feb 2018 07:23:35 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 12 Feb 2018 07:23:35 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.47]) by FMSMSX157.amr.corp.intel.com ([169.254.14.60]) with mapi id 14.03.0319.002; Mon, 12 Feb 2018 07:23:34 -0800 From: "Carsey, Jaben" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] ShellPkg/help: Fix "-?" may not show manual sometimes Shell core was enhanced to find the manual string in PE resource section. But the finding algorithm is too strict: If the manual is written beginning with: .TH command 0 "descript... Thread-Index: AQHTo0vdoG8B7NCEdUuy+6sglI5/mqOg5BOQ Date: Mon, 12 Feb 2018 15:23:34 +0000 Message-ID: References: <20180211151752.468524-1-ruiyu.ni@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzVhZWMxNDktNWZmMC00NTg2LWJiMjYtNTg2N2E5M2RlNGI4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjBHb0ZFcW0yMTVlaWxXSWtJM1pcLzVGVlVRZ1VQWEpXR1RuR1V4RTR1WjVZPSJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg/help: Fix "-?" may not show manual sometimes Shell core was enhanced to find the manual string in PE resource section. But the finding algorithm is too strict: If the manual is written beginning with: .TH command 0 "descript... X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 15:17:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SSB0aGluayB0aGF0IGlzIGZpbmUuICBJIGRvbuKAmXQgdGhpbmsgdGhhdCB0aGVyZSBpcyBhIGRp ZmZlcmVuY2UgZXhjZXB0IHRoZSBTaGVsbENsb3NlRmlsZSgpIGlzIG9ubHkgYXZhaWxhYmxlIGlu c2lkZSB0aGUgc2hlbGwsIHdoaWxlIHRoZSBwcm90b2NvbCBBUEkgaXMgYXZhaWxhYmxlIHRvIGFw cGxpY2F0aW9ucyB0aGF0IG9wZW4gdGhlIFNoZWxsUHJvdG9jb2wuDQoNCi1KYWJlbg0KDQo+IC0t LS0t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