From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: Re: [patch] add "underwave" face attribute Date: Sat, 4 Feb 2012 19:22:42 +0100 Message-ID: References: <037B3467A9FE4EC9B681DF3B1171A539@us.oracle.com> <87obtii1y4.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f46d04463270e3ad0704b8278353 X-Trace: dough.gmane.org 1328379779 22790 80.91.229.3 (4 Feb 2012 18:22:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 4 Feb 2012 18:22:59 +0000 (UTC) Cc: Juri Linkov , Juanma Barranquero , Stefan Monnier , Drew Adams , emacs-devel@gnu.org To: =?UTF-8?Q?Jan_Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 04 19:22:57 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RtkGG-0007fI-Bt for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2012 19:22:56 +0100 Original-Received: from localhost ([::1]:57178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtkGF-0005bG-IY for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2012 13:22:55 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtkGA-0005b7-0B for emacs-devel@gnu.org; Sat, 04 Feb 2012 13:22:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtkG3-0006u8-Lb for emacs-devel@gnu.org; Sat, 04 Feb 2012 13:22:49 -0500 Original-Received: from mail-tul01m020-f169.google.com ([209.85.214.169]:37092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtkG3-0006tw-As for emacs-devel@gnu.org; Sat, 04 Feb 2012 13:22:43 -0500 Original-Received: by obbta7 with SMTP id ta7so6910185obb.0 for ; Sat, 04 Feb 2012 10:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=kl5hFyRx3WT0Bjyll1JHJQxLJqBTyzv8mDqrKfzRxAA=; b=Cr2nTBtVGFxA3Bxa0jzJhnDjEcVmIb6PdPk64+PiDHbk3+gygvZfHBsiRYBLgEr54b Cmuwq0fyHPIE/evul6lkARBnDFps7kc26uXA7dEw49bhn+Cun0yaCAtL3H7cDpWFCkcj X7jz8ZnxHL3prQV2d/0Y48LDx+d0+5PGg0qkc= Original-Received: by 10.182.72.35 with SMTP id a3mr10995598obv.16.1328379762814; Sat, 04 Feb 2012 10:22:42 -0800 (PST) Original-Received: by 10.182.11.166 with HTTP; Sat, 4 Feb 2012 10:22:42 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: UPCVfGi44WoyM5KMuoxM3tpaQQM X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148163 Archived-At: --f46d04463270e3ad0704b8278353 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Feb 4, 2012 at 9:14 AM, Jan Dj=C3=A4rv wrote: > Just create a new GC. That's what I ended up doing, but the previous GC already sets a clipping region that I override when underwaving. This results in unneeded underwaving ie. visual glitches. I've looked deeply at the code and found a function that returns a simple clip rectangle of a glyph_string and used it with x_intersect_rectangles() to have the final clipping region. I then use the clip field of glyph_string to restore the previous clipping rectangles. I've done the same thing for Windows, it should work. Juanma, could you check again, please? Mac OSX clipping works differently and I'm not sure what to do... See XXX coments in nsterm.m Patch attached. --f46d04463270e3ad0704b8278353 Content-Type: text/x-patch; charset=US-ASCII; name="underwave-clip-1.patch" Content-Disposition: attachment; filename="underwave-clip-1.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gy8yzixu0 ZGlmZiAtLWdpdCBhL2RvYy9saXNwcmVmL2Rpc3BsYXkudGV4aSBiL2RvYy9saXNwcmVmL2Rpc3Bs YXkudGV4aQppbmRleCAzODFlYWY2Li40NjRkZmFhIDEwMDY0NAotLS0gYS9kb2MvbGlzcHJlZi9k aXNwbGF5LnRleGkKKysrIGIvZG9jL2xpc3ByZWYvZGlzcGxheS50ZXhpCkBAIC0yMDgwLDEwICsy MDgwLDMyIEBAIEJhY2tncm91bmQgY29sb3IsIGEgc3RyaW5nLiAgVGhlIHZhbHVlIGNhbiBiZSBh IHN5c3RlbS1kZWZpbmVkIGNvbG9yCiBuYW1lLCBvciBhIGhleGFkZWNpbWFsIGNvbG9yIHNwZWNp ZmljYXRpb24uICBAeHJlZntDb2xvciBOYW1lc30uCiAKIEBpdGVtIDp1bmRlcmxpbmUKLVdoZXRo ZXIgb3Igbm90IGNoYXJhY3RlcnMgc2hvdWxkIGJlIHVuZGVybGluZWQsIGFuZCBpbiB3aGF0IGNv bG9yLiAgSWYKLXRoZSB2YWx1ZSBpcyBAY29kZXt0fSwgdW5kZXJsaW5pbmcgdXNlcyB0aGUgZm9y ZWdyb3VuZCBjb2xvciBvZiB0aGUKLWZhY2UuICBJZiB0aGUgdmFsdWUgaXMgYSBzdHJpbmcsIHVu ZGVybGluaW5nIHVzZXMgdGhhdCBjb2xvci4gIFRoZQotdmFsdWUgQGNvZGV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LworCitzdGF0aWMgdm9pZAorbnNfZHJhd191bmRlcndhdmUg KGludCB4MCwgaW50IHkwLAorICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwKKyAgICAgICAg ICAgICAgICAgICBpbnQgd2F2ZV9oZWlnaHQsIGludCB3YXZlX2xlbmd0aCkKK3sKKyAgLyogSGVs cGVyIG1hY3JvIHRvIHJlLXVzZSBOU1BvaW50IGEgYW5kIGIgdG8gZHJhdyBsaW5lcy4gKi8KKyNk ZWZpbmUgRFJBV0xJTkUoeDEsIHkxLCB4MiwgeTIpICAgICAgICAgICAgICAgICAgICAgICAgXAor ICBkbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc CisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFwKKyAgICAgIGEueCA9IHgxLCBhLnkgPSB5MTsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAorICAgICAgYi54ID0geDIsIGIueSA9IHkyOyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBcCisgICAgICBbTlNCZXppZXJQYXRoIHN0cm9rZUxpbmVGcm9tUG9pbnQ6YSB0b1BvaW50 OiBiXTsgIFwKKyAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAorICB3aGlsZSAoMCkKKworICBOU1BvaW50IGEsIGI7CisgIGludCB3YXZlX2hl aWdodCA9IDIsIHdhdmVfbGVuZ3RoID0gMzsKKyAgaW50IGR4LCBkeSwgeDAsIHkwLCB3aWR0aCwg eDEsIHkxLCB4MiwgeTIsIG9kZCwgeG1heDsKKyAgWFJlY3RhbmdsZSB3YXZlX2NsaXAsIHN0cmlu Z19jbGlwLCBmaW5hbF9jbGlwOworCisgIGR4ID0gd2F2ZV9sZW5ndGg7CisgIGR5ID0gd2F2ZV9o ZWlnaHQgLSAxOworICB4MCA9IHMtPng7CisgIHkwID0gcy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ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGhl aWdodCA9IDIsIGxlbiA9IDMsIHkgPSBzLT55YmFzZSArIDE7CisKKyAgICAgICAgICBpZiAoZmFj ZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZh Y2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAKKyAgICAgICAgICBu c19kcmF3X3VuZGVyd2F2ZSAocy0+eCwgeSwgcy0+d2lkdGgsIGhlaWdodCwgbGVuKTsKICAgICAg ICAgfQotICAgICAgZWxzZQorICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUg PT0gRkFDRV9VTkRFUl9MSU5FKQogICAgICAgICB7Ci0gICAgICAgICAgc3RydWN0IGZvbnQgKmZv bnQ7Ci0gICAgICAgICAgdW5zaWduZWQgbG9uZyBkZXNjZW50OwotCi0gICAgICAgICAgZm9udD1z LT5mb250OwotICAgICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7 Ci0KLSAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZhdWx0 aW5nIHRvIDEuICovCi0gICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcyA+IDApCi0gICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25l c3MgOiAxOwotCi0gICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5p bmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCi0gICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rl c2NlbnRfbGluZSkKLSAgICAgICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIHRoaWNrbmVzczsK LSAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwot ICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49 IDApCi0gICAgICAgICAgICBwb3NpdGlvbiA9IGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKLSAg ICAgICAgICBlbHNlIGlmIChmb250KQotICAgICAgICAgICAgcG9zaXRpb24gPSBscm91bmQgKGZv bnQtPmRlc2NlbnQgLyAyKTsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICBwb3NpdGlvbiA9 IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKIAotICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChw b3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICBOU1JlY3QgcjsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CiAKLSAgICAgICAg ICAvKiBFbnN1cmUgdW5kZXJsaW5pbmcgaXMgbm90IGNyb3BwZWQuICovCi0gICAgICAgICAgaWYg KGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgLyogSWYgdGhlIHByZXYgd2FzIHVuZGVy bGluZWQsIG1hdGNoIGl0cyBhcHBlYXJhbmNlLiAqLworICAgICAgICAgIGlmIChzLT5wcmV2ICYm IHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVu ZGVybGluZV90aGlja25lc3MgPiAwKQogICAgICAgICAgICAgewotICAgICAgICAgICAgICBwb3Np dGlvbiA9IGRlc2NlbnQgLSAxOwotICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAg ICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAg ICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKICAgICAgICAg ICAgIH0KLSAgICAgICAgICBlbHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3Mp Ci0gICAgICAgICAgICB0aGlja25lc3MgPSAxOwotICAgICAgICB9CisgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAg ICAgICAgdW5zaWduZWQgbG9uZyBkZXNjZW50OworCisgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9u dDsKKyAgICAgICAgICAgICAgZGVzY2VudCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsK KworICAgICAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZh dWx0aW5nIHRvIDEuICovCisgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChmb250ICYmIGZvbnQt PnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcyA6IDE7CisKKyAgICAgICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZz ZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisgICAgICAgICAgICAgIGlm ICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250 ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICBlbHNlIGlmIChm b250KQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8g Mik7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVy bGluZV9taW5pbXVtX29mZnNldDsKIAotICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRo aWNrbmVzczsKLSAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAg ICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNl dCk7CiAKLSAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0 aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlzIG5v dCBjcm9wcGVkLiAqLworICAgICAgICAgICAgICBpZiAoZGVzY2VudCA8PSBwb3NpdGlvbikKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSAx OworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgfQogCi0gICAgICBpZiAo ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQotICAgICAgICBbZGVmYXVsdENvbCBzZXRdOwot ICAgICAgZWxzZQotICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29s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IGluIFMgKi8KK3N0YXRpYyB2b2lkCit3MzJfcmVzdG9yZV9nbHlwaF9zdHJpbmdf Y2xpcCAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgUkVDVCAqciA9IHMtPmNsaXA7Cisg IGludCBuID0gcy0+bnVtX2NsaXBzOworCisgIGlmIChuID09IDEpCisgICAgdzMyX3NldF9jbGlw X3JlY3RhbmdsZSAocy0+aGRjLCByKTsKKyAgZWxzZSBpZiAobiA+IDEpCisgICAgeworICAgICAg SFJHTiBjbGlwMSA9IENyZWF0ZVJlY3RSZ25JbmRpcmVjdCAocik7CisgICAgICBIUkdOIGNsaXAy ID0gQ3JlYXRlUmVjdFJnbkluZGlyZWN0IChyICsgMSk7CisgICAgICBpZiAoQ29tYmluZVJnbiAo Y2xpcDEsIGNsaXAxLCBjbGlwMiwgUkdOX09SKSAhPSBFUlJPUikKKyAgICAgICAgU2VsZWN0Q2xp cFJnbiAocy0+aGRjLCBjbGlwMSk7CisgICAgICBEZWxldGVPYmplY3QgKGNsaXAxKTsKKyAgICAg IERlbGV0ZU9iamVjdCAoY2xpcDIpOworICAgIH0KK30KKworLyoKKyAgIERyYXcgYSB3YXZ5IGxp bmUgdW5kZXIgUy4gVGhlIHdhdmUgZmlsbHMgd2F2ZV9oZWlnaHQgcGl4ZWxzIGZyb20geTAuCisK KyAgICAgICAgICAgICAgICAgICAgeDAgICAgICAgICB3YXZlX2xlbmd0aCA9IDIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC0tCisgICAgICAgICAgICAgICAgeTAgICAqICAgKiAg ICogICAqICAgKgorICAgICAgICAgICAgICAgICAgICAgfCogKiAqICogKiAqICogKiAqCisgICAg d2F2ZV9oZWlnaHQgPSAzICB8ICogICAqICAgKiAgICoKKworKi8KKwordm9pZAordzMyX2RyYXdf dW5kZXJ3YXZlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBDT0xPUlJFRiBjb2xvcikKK3sKKyAg aW50I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gMjsKKyAgeTEgPSB5MiA9IHkwOworCisgIGlmIChvZGQpCisg ICAgeTEgKz0gZHk7CisgIGVsc2UKKyAgICB5MiArPSBkeTsKKworICBNb3ZlVG9FeCAocy0+aGRj LCB4MSwgeTEsIE5VTEwpOworCisgIHdoaWxlICh4MSA8PSB4bWF4KQorICAgIHsKKyAgICAgIExp bmVUbyAocy0+aGRjLCB4MiwgeTIpOworICAgICAgeDEgID0geDIsIHkxID0geTI7CisgICAgICB4 MiArPSBkeCwgeTIgPSB5MCArIG9kZCpkeTsKKyAgICAgIG9kZCA9ICFvZGQ7CisgICAgfQorCisg IC8qIFJlc3RvcmUgcHJldmlvdXMgcGVuIGFuZCBjbGlwcGluZyByZWN0YW5nbGUocykgKi8KKyAg dzMyX3Jlc3RvcmVfZ2x5cGhfc3RyaW5nX2NsaXAgKHMpOworICBTZWxlY3RPYmplY3QgKHMtPmhk Yywgb2xkaHApOworICBEZWxldGVPYmplY3QgKGhwKTsKK30KIAogLyogRHJhdyBhIGhvbGxvdyBy ZWN0YW5nbGUgYXQgdGhlIHNwZWNpZmllZCBwb3NpdGlvbi4gICovCiB2b2lkCkBAIC0yMzQzLDYw ICsyNDMwLDc0IEBAIHhfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMp CiAgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCiAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJs aW5lX3ApCiAgICAgICAgIHsKLSAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9z aXRpb247Ci0gICAgICAgICAgaW50IHk7Ci0KLSAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5l X3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQogICAgICAgICAgICAgewotICAgICAgICAgICAgICAv KiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAq LwotICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNz OwotICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdj LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisKKyAgICAgICAgICAgICAgdzMyX2RyYXdfdW5k ZXJ3YXZlIChzLCBjb2xvcik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZQorICAgICAg ICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkK ICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tu ZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAgKi8KLSAgICAgICAgICAgICAgaWYgKHMtPmZvbnQg JiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCi0gICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKwor ICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcCkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUg dW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgIH0KICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9 IDE7Ci0gICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCi0gICAg ICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFz ZSAtIHMtPnkpOworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworCisgICAgICAgICAgICAgICAgICAgICAgICAg Uk9VTkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisKKyAgICAgICAgICAgICAgICAg ICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24g Pj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJs aW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkg LyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQg cG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRl cmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlm IChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAg ICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhp Y2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAt IChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNr bmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1w b3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAg ICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5n Yy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHks IHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgIGVsc2UKICAg ICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9z aXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAotICAgICAgICAgICAgICAgICAgIHZlcnRp Y2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgotICAg ICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFj Y29yZGluZyB0byB0aGUKLSAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0 IGlzCi0KLSAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwg d2l0aAotICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8K LQotICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGll cwotICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9w b3NpdGlvbiA+PSAwKQotICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRl cmxpbmVfcG9zaXRpb247Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKLSAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAg ICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVy bGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMt PndpZHRoLCAxKTsKICAgICAgICAgICAgICAgICB9Ci0JICAgICAgcG9zaXRpb24gPSBtYXggKHBv c2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOwotICAgICAgICAgICAgfQotCSAgLyog Q2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCi0J ICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVh LiAgKi8KLQkgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCi0J ICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7Ci0JICBp ZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCi0J ICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9u KTsKLQkgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7Ci0JICBzLT51bmRlcmxp bmVfcG9zaXRpb24gPXBvc2l0aW9uOwotICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9u OwotICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCi0gICAgICAg ICAgICB7Ci0gICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2Mt PmZvcmVncm91bmQsIHMtPngsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndp ZHRoLCAxKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0g ICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJs aW5lX2NvbG9yLCBzLT54LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0 aCwgMSk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgIC8qIERyYXcgb3ZlcmxpbmUu ICAqLwpkaWZmIC0tZ2l0IGE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SAwKSkKLQkgIHNpZ25hbF9lcnJvciAoIkludmFsaWQgZmFjZSB1 bmRlcmxpbmUiLCB2YWx1ZSk7Ci0KKyAgICAgIGludCB2YWxpZF9wID0gMDsKKyAgICAgIAorICAg ICAgaWYgKFVOU1BFQ0lGSUVEUCAodmFsdWUpIHx8IElHTk9SRV9ERUZGQUNFX1AgKHZhbHVlKSkK Kwl2YWxpZF9wID0gMTsKKyAgICAgIGVsc2UgaWYgKE5JTFAgKHZhbHVlKSB8fCBFUSAodmFsdWUs IFF0KSkKKyAgICAgICAgdmFsaWRfcCA9IDE7CisgICAgICBlbHNlIGlmIChTVFJJTkdQICh2YWx1 ZSkgJiYgU0NIQVJTICh2YWx1ZSkgPiAwKQorICAgICAgICB2YWxpZF9wID0gMTsKKyAgICAgIGVs c2UgaWYgKENPTlNQICh2YWx1ZSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBr ZXksIHZhbCwgbGlzdDsKKworICAgICAgICAgIGxpc3QgPSB2YWx1ZTsKKyAgICAgICAgICB2YWxp ZF9wID0gMTsKKworICAgICAgICAgIHdoaWxlICghTklMUCAoQ0FSX1NBRkUobGlzdCkpKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBrZXkgPSBDQVJfU0FGRSAobGlzdCk7CisgICAgICAg ICAgICAgIGxpc3QgPSBDRFJfU0FGRSAobGlzdCk7CisgICAgICAgICAgICAgIHZhbCA9IENBUl9T QUZFIChsaXN0KTsKKyAgICAgICAgICAgICAgbGlzdCA9IENEUl9TQUZFIChsaXN0KTsKKyAgICAg ICAgICAgIAorICAgICAgICAgICAgICBpZihOSUxQIChrZXkpIHx8IE5JTFAgKHZhbCkpIAorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHZhbGlkX3AgPSAwOworICAgICAgICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIGVsc2Ug aWYgKEVRIChrZXksIFFDY29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoRVEgKHZh bCwgUWZvcmVncm91bmRfY29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKFNU UklOR1AgKHZhbCkgJiYgU0NIQVJTICh2YWwpID4gMCkpKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIHZhbGlkX3AgPSAwOworICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgZWxzZSBpZiAo RVEgKGtleSwgUUNzdHlsZSkgCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoRVEgKHZhbCwg UWxpbmUpIHx8IEVRICh2YWwsIFF3YXZlKSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgdmFsaWRfcCA9IDA7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIAorICAgICAgaWYgKCF2 YWxpZF9wKQorICAgICAgICBzaWduYWxfZXJyb3IgKCJJbnZhbGlkIGZhY2UgdW5kZXJsaW5lIiwg dmFsdWUpOworICAgICAgCiAgICAgICBvbGRfdmFsdWUgPSBMRkFDRV9VTkRFUkxJTkUgKGxmYWNl KTsKICAgICAgIExGQUNFX1VOREVSTElORSAobGZhY2UpID0gdmFsdWU7CiAgICAgfQpAQCAtMzc2 Miw2ICszODA0LDcgQEAgVmFsdWUgaXMgbmlsIGlmIEFUVFIgZG9lc24ndCBoYXZlIGEgZGlzY3Jl dGUgc2V0IG9mIHZhbGlkIHZhbHVlcy4gICovKQogCiAgIENIRUNLX1NZTUJPTCAoYXR0cik7CiAK KyAgLyogWFhYOiBubyBjaGVjayBmb3IgUUNib3g/ICovCiAgIGlmIChFUSAoYXR0ciwgUUN1bmRl cmxpbmUpKQogICAgIHJlc3VsdCA9IEZjb25zIChRdCwgRmNvbnMg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gICAgZmFjZS0+dW5kZXJsaW5lX2NvbG9yID0gMDsKKyAgICAgIGZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCA9IDE7CisgICAgICBmYWNlLT51bmRlcmxpbmVfdHlwZSA9 IEZBQ0VfVU5ERVJfTElORTsKKworICAgICAgd2hpbGUgKENPTlNQICh1bmRlcmxpbmUpKQorICAg ICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3Qga2V5d29yZCwgdmFsdWU7CisKKyAgICAgICAg ICBrZXl3b3JkID0gWENBUiAodW5kZXJsaW5lKTsKKyAgICAgICAgICB1bmRlcmxpbmUgPSBYQ0RS ICh1bmRlcmxpbmUpOworCisgICAgICAgICAgaWYgKCFDT05TUCAodW5kZXJsaW5lKSkKKyAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgIHZhbHVlID0gWENBUiAodW5kZXJsaW5lKTsKKyAgICAg ICAgICB1bmRlcmxpbmUgPSBYQ0RSICh1bmRlcmxpbmUpOworCisgICAgICAgICAgaWYgKEVRIChr ZXl3b3JkLCBRQ2NvbG9yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEVRICh2 YWx1ZSwgUWZvcmVncm91bmRfY29sb3IpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICBmYWNlLT51bmRlcmxpbmVfY29sb3IgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZSBpZiAoU1RSSU5HUCAodmFsdWUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCA9IDA7CisgICAgICAgICAg ICAgICAgICBmYWNlLT51bmRlcmxpbmVfY29sb3IgPSBsb2FkX2NvbG9yIChmLCBmYWNlLCB2YWx1 ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IExGQUNFX1VOREVSTElORV9JTkRFWCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg fQorICAgICAgICAgIGVsc2UgaWYgKEVRIChrZXl3b3JkLCBRQ3N0eWxlKSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgaWYgKEVRICh2YWx1ZSwgUWxpbmUpKQorICAgICAgICAgICAgICAg IGZhY2UtPnVuZGVybGluZV90eXBlID0gRkFDRV9VTkRFUl9MSU5FOworICAgICAgICAgICAgICBl bHNlIGlmIChFUSAodmFsdWUsIFF3YXZlKSkKKyAgICAgICAgICAgICAgICBmYWNlLT51bmRlcmxp bmVfdHlwZSA9IEZBQ0VfVU5ERVJfV0FWRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgCiAgIG92ZXJsaW5lID0gYXR0cnNbTEZBQ0VfT1ZFUkxJTkVfSU5ERVhdOwogICBpZiAo U1RSSU5HUCAob3ZlcmxpbmUpKQogICAgIHsKQEAgLTY0NjUsNiArNjU1NSw4IEBAIHN5bXNfb2Zf eGZhY2VzICh2b2lkKQogICBERUZTWU0gKFFDY29sb3IsICI6Y29sb3IiKTsKICAgREVGU1lNIChR Q2xpbmVfd2lkdGgsICI6bGluZS13aWR0aCIpOwogICBERUZTWU0gKFFDc3R5bGUsICI6c3R5bGUi KTsKKyAgREVGU1lNIChRbGluZSwgImxpbmUiKTsKKyAgREVGU1lNIChRd2F2ZSwgIndhdmUiKTsK ICAgREVGU1lNIChRcmVsZWFzZWRfYnV0dG9uLCAicmVsZWFzZWQtYnV0dG9uIik7CiAgIERFRlNZ TSAoUXByZXNzZWRfYnV0dG9uLCAicHJlc3NlZC1idXR0b24iKTsKICAgREVGU1lNIChRbm9ybWFs LCAibm9ybWFsIik7CmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmluZGV4 IDRiMzRkNjMuLm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XVs dGVkX3ApCisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMg eGdjdjsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2Ms IEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAg ICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQg eTsKIAorICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxp bmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhl IHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQg aXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250 LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlm ICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21t ZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxz IGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAg ICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhl CisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworCisg ICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVtIGRlc2NlbnQpIC8gMiksIHdp dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCh4KSA9IGZsb29yICh4ICsgMC41KSAg Ki8KKworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZv bnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g bWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBw b3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVy bGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYg KHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAg ICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAg ICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlj a25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0g KHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tu ZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAg ICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAg ICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgcy0+Z2MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOwor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg WEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3Bs YXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsK KyAgICAgICAgICAgICAgICAgIFhGaWxsUmVjdGFuZ2xlIChzLT5kaXNwbGF5LCBzLT53aW5kb3cs IHMtPmdjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndp ZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRp c3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIH0KKyAgICAgICAgfQogICAgICAgLyogRHJhdyBvdmVybGluZS4gICovCiAgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKIAl7Cg== --f46d04463270e3ad0704b8278353--