From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web10.5453.1610528126432671367 for ; Wed, 13 Jan 2021 00:55:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EVIDZh/6; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610528125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WtGMGkgGcMvq1VgWVCJI7EgziQNgyuo5fOHuBnlMyLA=; b=EVIDZh/6dqwqBEYkJ9SjmLEsJhLVwdWgenIF0xl8+w3RQEfLA1i009hwdrFxLoSC2gzOBJ Oy0C2KEHDI1YsnFz2QuwnsN8S05O7aaswxaexqtN+rp84Gju3yDAPIaApFYwi1noOSZ4eX 6NAuO5YNM1UPukBa/TInT+R576V1uPk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-nuSIEt-CNxmhxMBldQQOrw-1; Wed, 13 Jan 2021 03:55:23 -0500 X-MC-Unique: nuSIEt-CNxmhxMBldQQOrw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57F278066E0; Wed, 13 Jan 2021 08:55:22 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-238.ams2.redhat.com [10.36.112.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3717D5C239; Wed, 13 Jan 2021 08:55:18 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ray Ni , Zhichao Gao Subject: [PATCH v2 06/10] ShellPkg/ShellCommandLib: add ShellSortFileList() Date: Wed, 13 Jan 2021 09:54:49 +0100 Message-Id: <20210113085453.10168-7-lersek@redhat.com> In-Reply-To: <20210113085453.10168-1-lersek@redhat.com> References: <20210113085453.10168-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 SW50cm9kdWNlIHRoZSBTaGVsbFNvcnRGaWxlTGlzdCgpIGZ1bmN0aW9uLCBmb3Igc29ydGluZyBh bgpFRklfU0hFTExfRklMRV9JTkZPIGxpc3QsIGJ5IEZpbGVOYW1lIG9yIGJ5IEZ1bGxOYW1lLgoK RHVwbGljYXRlcyBjYW4gYmUga2VwdCBpbiB0aGUgc2FtZSBsaXN0LCBvciBzZXBhcmF0ZWQgb3V0 IHRvIGEgbmV3IGxpc3QuCkluIGVpdGhlciBjYXNlLCB0aGUgcmVsYXRpdmUgb3JkZXIgYmV0d2Vl biBkdXBsaWNhdGVzIGRvZXMgbm90IGNoYW5nZSAodGhlCnNvcnRpbmcgaXMgc3RhYmxlKS4KCkZv ciB0aGUgc29ydGluZywgdXNlIE9yZGVyZWRDb2xsZWN0aW9uTGliIHJhdGhlciB0aGFuIFNvcnRM aWI6CgotIFRoZSBQZXJmb3JtUXVpY2tTb3J0KCkgZnVuY3Rpb24gZnJvbSB0aGUgbGF0dGVyIGhh cyBxdWFkcmF0aWMgd29yc3QtY2FzZQogIHRpbWUgY29tcGxleGl0eSwgcGx1cyBpdCBpcyBpbXBs ZW1lbnRlZCByZWN1cnNp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zb3J0ZWQsIGxpc3QuDQorDQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgT3RoZXJ3aXNlLCBpZiAoKkZpbGVMaXN0KSBpcyBOVUxMIG9uIGlucHV0 LCB0aGVuDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgRUZJX0lOVkFMSURfUEFSQU1FVEVS IGlzIHJldHVybmVkLg0KKw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE90aGVyd2lzZSwg dGhlIGNhbGxlciBpcyByZXNwb25zaWJsZSBmb3IgaGF2aW5nDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW5pdGlhbGl6ZWQgKCpGaWxlTGlzdCktPkxpbmsgd2l0aA0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIEluaXRpYWxpemVMaXN0SGVhZCgpLiBObyBvdGhlciBmaWVsZHMgaW4g dGhlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoqRmlsZUxpc3QpIGhlYWQgZWxlbWVu dCBhcmUgYWNjZXNzZWQgYnkgdGhpcw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0 aW9uLg0KKw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIE9uIG91dHB1dCwgKCpGaWxlTGlz dCkgaXMgc29ydGVkIGFjY29yZGluZyB0byBPcmRlci4NCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBJZiBEdXBsaWNhdGVzIGlzIE5VTEwgb24gaW5wdXQsIHRoZW4gZHVwbGljYXRlDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudHMgYXJlIHByZXNlcnZlZCwgc29ydGVkIHN0 YWJseSwgb24NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKkZpbGVMaXN0KS4gSWYgRHVw bGljYXRlcyBpcyBub3QgTlVMTCBvbiBpbnB1dCwNCisgICAgICAgICAgICAgICAgICAgICAgICAg ICB0aGVuIGR1cGxpY2F0ZXMgYXJlIG1vdmVkIChzdGFibHkgc29ydGVkKSB0byB0aGUNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBuZXcsIGR5bmFtaWNhbGx5IGFsbG9jYXRlZCAoKkR1cGxp Y2F0ZXMpIGxpc3QuDQorDQorICBAcGFyYW1bb3V0XSBEdXBsaWNhdGVzICAgSWYgRHVwbGljYXRl cyBpcyBOVUxMIG9uIGlucHV0LCAoKkZpbGVMaXN0KSB3aWxsIGJlDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgYSBtb25vdG9uaWNhbGx5IG9yZGVyZWQgbGlzdCBvbiBvdXRwdXQsIHdpdGgN CisgICAgICAgICAgICAgICAgICAgICAgICAgICBkdXBsaWNhdGVzIHN0YWJseSBzb3J0ZWQuDQor DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgSWYgRHVwbGljYXRlcyBpcyBub3QgTlVMTCBv biBpbnB1dCwgKCpGaWxlTGlzdCkgd2lsbA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGJl IGEgc3RyaWN0bHkgbW9ub3RvbmljYWxseSBvcmVkZXJlZCBsaXN0IG9uIG91dHB1dCwNCisgICAg ICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGR1cGxpY2F0ZXMgc2VwYXJhdGVkIChzdGFibHkg c29ydGVkKSB0bw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICgqRHVwbGljYXRlcykuIEFs bCBmaWVsZHMgZXhjZXB0IExpbmsgd2lsbCBiZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHplcm8taW5pdGlhbGl6ZWQgaW4gdGhlICgqKkR1cGxpY2F0ZXMpIGhlYWQgZWxlbWVudC4NCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBJZiBubyBkdXBsaWNhdGVzIGV4aXN0LCB0aGVuICgq RHVwbGljYXRlcykgaXMgc2V0IHRvDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCBv biBvdXRwdXQuDQorDQorICBAcGFyYW1baW5dIE9yZGVyICAgICAgICAgRGV0ZXJtaW5lcyB0aGUg Y29tcGFyaXNvbiBvcGVyYXRpb24gYmV0d2Vlbg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg IEVGSV9TSEVMTF9GSUxFX0lORk8gb2JqZWN0cy4NCisNCisgIEByZXR2YWwgRUZJX0lOVkFMSURf UEFSQU1FVEVSICAoVUlOVE4pT3JkZXIgaXMgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFVJTlROKVNoZWxsU29ydEZpbGVMaXN0TWF4 LiBOZWl0aGVyIHRoZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqRmlsZUxp c3QpIG5vciB0aGUgKCpEdXBsaWNhdGVzKSBsaXN0IGhhcw0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJlZW4gbW9kaWZpZWQuDQorDQorICBAcmV0dmFsIEVGSV9JTlZBTElEX1BB UkFNRVRFUiAgKCpGaWxlTGlzdCkgd2FzIE5VTEwgb24gaW5wdXQuIE5laXRoZXIgdGhlDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCpGaWxlTGlzdCkgbm9yIHRoZSAoKkR1cGxp Y2F0ZXMpIGxpc3QgaGFzDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVlbiBt b2RpZmllZC4NCisNCisgIEByZXR2YWwgRUZJX09VVF9PRl9SRVNPVVJDRVMgICBNZW1vcnkgYWxs b2NhdGlvbiBmYWlsZWQuIE5laXRoZXIgdGhlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKCpGaWxlTGlzdCkgbm9yIHRoZSAoKkR1cGxpY2F0ZXMpIGxpc3QgaGFzDQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVlbiBtb2RpZmllZC4NCisNCisgIEByZXR2YWwg RUZJX1NVQ0NFU1MgICAgICAgICAgICBTb3J0aW5nIHN1Y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g ICAgICAgICAgIChDSEFSMTYgKilVbmlxdWVBbGlhcywNCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoQ0hBUjE2ICopVW5pcXVlLT5BbGlhcw0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICk7DQorfQ0KKw0KKy8qKg0KKyAgU29ydCBhbiBFRklfU0hFTExfRklMRV9JTkZPIGxp c3QsIG9wdGlvbmFsbHkgbW92aW5nIGR1cGxpY2F0ZXMgdG8gYSBzZXBhcmF0ZQ0KKyAgbGlzdC4N CisNCisgIEBwYXJhbVtpbixvdXRdIEZpbGVMaXN0ICBUaGUgbGlzdCBvZiBFRklfU0hFTExfRklM RV9JTkZPIG9iamVjdHMgdG8gc29ydC4NCisNCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJ ZiBGaWxlTGlzdCBpcyBOVUxMIG9uIGlucHV0LCB0aGVuIEZpbGVMaXN0IGlzDQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgY29uc2lkZXJlZCBhbiBlbXB0eSwgaGVuY2UgYWxyZWFkeSBzb3J0 ZWQsIGxpc3QuDQorDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgT3RoZXJ3aXNlLCBpZiAo KkZpbGVMaXN0KSBpcyBOVUxMIG9uIGlucHV0LCB0aGVuDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgRUZJX0lOVkFMSURfUEFSQU1FVEVSIGlzIHJldHVybmVkLg0KKw0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIE90aGVyd2lzZSwgdGhlIGNhbGxlciBpcyByZXNwb25zaWJsZSBmb3Ig aGF2aW5nDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZWQgKCpGaWxlTGlz dCktPkxpbmsgd2l0aA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEluaXRpYWxpemVMaXN0 SGVhZCgpLiBObyBvdGhlciBmaWVsZHMgaW4gdGhlDQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCoqRmlsZUxpc3QpIGhlYWQgZWxlbWVudCBhcmUgYWNjZXNzZWQgYnkgdGhpcw0KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uLg0KKw0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIE9uIG91dHB1dCwgKCpGaWxlTGlzdCkgaXMgc29ydGVkIGFjY29yZGluZyB0byBPcmRl ci4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiBEdXBsaWNhdGVzIGlzIE5VTEwgb24g aW5wdXQsIHRoZW4gZHVwbGljYXRlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVu dHMgYXJlIHByZXNlcnZlZCwgc29ydGVkIHN0YWJseSwgb24NCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKkZpbGVMaXN0KS4gSWYgRHVwbGljYXRlcyBpcyBub3QgTlVMTCBvbiBpbnB1dCwN CisgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGVuIGR1cGxpY2F0ZXMgYXJlIG1vdmVkIChz dGFibHkgc29ydGVkKSB0byB0aGUNCisgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcsIGR5 bmFtaWNhbGx5IGFsbG9jYXRlZCAoKkR1cGxpY2F0ZXMpIGxpc3QuDQorDQorICBAcGFyYW1bb3V0 XSBEdXBsaWNhdGVzICAgSWYgRHVwbGljYXRlcyBpcyBOVUxMIG9uIGlucHV0LCAoKkZpbGVMaXN0 KSB3aWxsIGJlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgYSBtb25vdG9uaWNhbGx5IG9y ZGVyZWQgbGlzdCBvbiBvdXRwdXQsIHdpdGgNCisgICAgICAgICAgICAgICAgICAgICAgICAgICBk dXBsaWNhdGVzIHN0YWJseSBzb3J0ZWQuDQorDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg SWYgRHVwbGljYXRlcyBpcyBub3QgTlVMTCBvbiBpbnB1dCwgKCpGaWxlTGlzdCkgd2lsbA0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGEgc3RyaWN0bHkgbW9ub3RvbmljYWxseSBvcmVk ZXJlZCBsaXN0IG9uIG91dHB1dCwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGR1 cGxpY2F0ZXMgc2VwYXJhdGVkIChzdGFibHkgc29ydGVkKSB0bw0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICgqRHVwbGljYXRlcykuIEFsbCBmaWVsZHMgZXhjZXB0IExpbmsgd2lsbCBiZQ0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgIHplcm8taW5pdGlhbGl6ZWQgaW4gdGhlICgqKkR1 cGxpY2F0ZXMpIGhlYWQgZWxlbWVudC4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJZiBu byBkdXBsaWNhdGVzIGV4aXN0LCB0aGVuICgqRHVwbGljYXRlcykgaXMgc2V0IHRvDQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgTlVMTCBvbiBvdXRwdXQuDQorDQorICBAcGFyYW1baW5dIE9y ZGVyICAgICAgICAgRGV0ZXJtaW5lcyB0aGUgY29tcGFyaXNvbiBvcGVyYXRpb24gYmV0d2Vlbg0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9TSEVMTF9GSUxFX0lORk8gb2JqZWN0cy4N CisNCisgIEByZXR2YWwgRUZJX0lOVkFMSURfUEFSQU1FVEVSICAoVUlOVE4pT3JkZXIgaXMgZ3Jl YXRlciB0aGFuIG9yIGVxdWFsIHRvDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KFVJTlROKVNoZWxsU29ydEZpbGVMaXN0TWF4LiBOZWl0aGVyIHRoZQ0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgqRmlsZUxpc3QpIG5vciB0aGUgKCpEdXBsaWNhdGVzKSBsaXN0 IGhhcw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlZW4gbW9kaWZpZWQuDQor DQorICBAcmV0dmFsIEVGSV9JTlZBTElEX1BBUkFNRVRFUiAgKCpGaWxlTGlzdCkgd2FzIE5VTEwg b24gaW5wdXQuIE5laXRoZXIgdGhlDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KCpGaWxlTGlzdCkgbm9yIHRoZSAoKkR1cGxpY2F0ZXMpIGxpc3QgaGFzDQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYmVlbiBtb2RpZmllZC4NCisNCisgIEByZXR2YWwgRUZJX09V VF9PRl9SRVNPVVJDRVMgICBNZW1vcnkgYWxsb2NhdGlvbiBmYWlsZWQuIE5laXRoZXIgdGhlDQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCpGaWxlTGlzdCkgbm9yIHRoZSAoKkR1 cGxpY2F0ZXMpIGxpc3QgaGFzDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVl biBtb2RpZmllZC4NCisNCisgIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAgICAgICBTb3J0aW5n IHN1Y2Nlc3NmdWwsIGluY2x1ZGluZyB0aGUgY2FzZSB3aGVuDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgRmlsZUxpc3QgaXMgTlVMTCBvbiBpbnB1dC4NCisqKi8NCitFRklfU1RB VFVTDQorRUZJQVBJDQorU2hlbGxTb3J0RmlsZUxpc3QgKA0KKyAgSU4gT1VUIEVGSV9TSEVMTF9G SUxFX0lORk8gICoqRmlsZUxpc3QsDQorICAgICBPVVQgRUZJX1NIRUxMX0ZJTEVfSU5GTyAgKipE dXBsaWNhdGVzIE9QVElPTkFMLA0KKyAgSU4gICAgIFNIRUxMX1NPUlRfRklMRV9MSVNUIE9yZGVy DQorICApDQorew0KKyAgTElTVF9FTlRSWSAgICAgICAgICAgICAgICpGaWxlc0hlYWQ7DQorICBP UkRFUkVEX0NPTExFQ1RJT04gICAgICAgKlNvcnQ7DQorICBMSVNUX0VOV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