From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11016 invoked by alias); 20 Jun 2018 17:47:18 -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: 43080 Received: (qmail 22697 invoked by uid 1010); 20 Jun 2018 17:47:18 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp 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(133.208.100.4):SA:0(-2.6/5.0):. Processed in 1.974808 secs); 20 Jun 2018 17:47:18 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH] _sys_calls: analyze recent syscall.h properly Message-Id: <6BB52D51-B35B-4529-B362-DDE98C33F18D@kba.biglobe.ne.jp> Date: Thu, 21 Jun 2018 02:11:16 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 61706 On recent Fedora (at least 27 and 28), and maybe on other distributions, /usr/include/bits/syscall.h contains lines like # define SYS_open __NR_open _sys_calls doesn't work due the space between '#' and 'define'. diff --git a/Completion/Unix/Type/_sys_calls = b/Completion/Unix/Type/_sys_calls index bd9b34f70..dadf2b1a4 100644 --- a/Completion/Unix/Type/_sys_calls +++ b/Completion/Unix/Type/_sys_calls @@ -12,7 +12,7 @@ local -au syscalls zparseopts -D -K -E a=3Dall n=3Dnone =20 [[ $OSTYPE =3D linux* ]] && ifile=3D/usr/include/bits/syscall.h -syscalls=3D( = ${${${(M)${(f)"$(<$ifile)"}:#?define[[:blank:]]##SYS_*}#*[[:blank:]]SYS_}%= %[[:blank:]]*} ) 2>/dev/null +syscalls=3D( = ${${${(M)${(f)"$(<$ifile)"}:#\#[[:blank:]]#define[[:blank:]]##SYS_*}#*[[:b= lank:]]SYS_}%%[[:blank:]]*} ) 2>/dev/null [[ -n $all ]] && syscalls+=3D( all ) [[ -n $none ]] && syscalls+=3D( none ) =20