From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2623 invoked by alias); 17 Nov 2017 09:19:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42027 Received: (qmail 6598 invoked by uid 1010); 17 Nov 2017 09:19:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot0-f179.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.179):SA:0(-1.9/5.0):. Processed in 8.292293 secs); 17 Nov 2017 09:19:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: evanunderscore@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=0nB2DukRW49VUniuO4+PWX4AEq8suTDa2/X4RYgbnHM=; b=phLPFESJhI0RGZYsOfboHhGjZZqO0pTn0/USxh1kF6swvY36tEYaleXXqwjRJc3tGu NW598YA2MUYbhlQvYP+JpM+FYgjYp/6ugpHLcawyBTEi2kjQ8zyUFX4NAp7hMHJm6Yig ah4A9FQUTnmtqUdZZNsSRNG+BWM3jhbRs6nudVN4EqtxnM5k+kKNEy+EmP3nzktbS1cc YomqUYYk7itpFvRzj6HZ8q6chbKH7gDBjrtL5+BEsShcqkLgM+IjE6x/Dl8tH4FQCMPv 5t6kLiyBqGS0WVNBfu6yzXp1fc9XUEWOm8xTf8OV4BqymiWKkxIBCE6u98OoHPc7fqKP ZnFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=0nB2DukRW49VUniuO4+PWX4AEq8suTDa2/X4RYgbnHM=; b=PmAUr5CS3TuhgJlgKbZ+QBwVfAUI30xLoV/91hoR8x3W8Vmezb4ndyp4gKzxccuXDo MRgJY5JqUt54FmfPA9EhjcwZpVJ/BHR9rL3dOtS778UcUYuFqFWZgG+98Q5vx9NnkpH8 iXEYyPQrnkSXiFmhiWUhOllnmGsSJrnjC6TklH3wLK7JQcymclFM3OOGuRunFBzTc636 uGr74xF7ZtSJOjq2LAiSuf5YsHbjh0q/95g6Y6puE0g/iDN86SyUN6YNc+mppIlCq4XI 0x6QUsTfuvJoM6Eol7OnIg+NQBOewqNjymW08+Z2Fcb+rz2WvHU86GnRzv/89V+Wjeur JKXg== X-Gm-Message-State: AJaThX4zMKRJaj+h2H2gkzC8tcnPcz1nc8xKrZdPCSboiOHpa2Xfv8lU WM8uKRLzhtOP5BLz4jKO65BzpAGCOAbPRStu2DoScYf+ X-Google-Smtp-Source: AGs4zMa9rOdAS6jEN8DkCzFZZV0ziVcVLlFX3VshcVjbFHdWfQoywSnTYz14QUaA4YGtoOxhkHHmkZUegN9tdbO0jd4= X-Received: by 10.157.50.16 with SMTP id t16mr849545otc.44.1510910366089; Fri, 17 Nov 2017 01:19:26 -0800 (PST) MIME-Version: 1.0 Sender: evan.andrews.au@gmail.com X-Google-Sender-Delegation: evan.andrews.au@gmail.com From: Evan Underscore Date: Fri, 17 Nov 2017 20:19:25 +1100 X-Google-Sender-Auth: 3k4i-QkDp3V-JKX7WnnSfIcS58A Message-ID: Subject: bashcompinit incorrectly calculates COMP_LINE (proposed fix included) To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="f4030435c11ca884aa055e2a3b7d" --f4030435c11ca884aa055e2a3b7d Content-Type: text/plain; charset="UTF-8" Hi all, A user discovered a bug in bashcompinit that causes COMP_LINE to be incorrectly calculated. A summary of the incorrect behaviour is here: https://github.com/kislyuk/argcomplete/issues/228#issuecomment-327696251 (Note some of the surrounding discussion is incorrect - this bug is unrelated to unicode.) The table at the bottom of this comment summarises how bashcompinit differs in its calculation of COMP_POINT. The change that caused the bug appears to have been introduced here: https://github.com/zsh-users/zsh/commit/23907bb840c80eef99eabba17e086e44c9b2d3fc#diff-b8d49b00032bcbfcdc709649f5d68505R11 Reverting this line (i.e. using CURRENT-1 instead of CURRENT, as it was before this commit) fixes the bug for me, causing zsh to report 18 and 19 for the two test lines respectively, matching Bash. I am not a subscriber; please send responses to this email address. I wish to note the resolution of this on the argcomplete ticket. Thanks, Evan. --f4030435c11ca884aa055e2a3b7d--