zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _sys_calls: analyze recent syscall.h properly
@ 2018-06-20 17:11 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2018-06-20 17:11 UTC (permalink / raw)
  To: zsh-workers

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=all n=none
 
 [[ $OSTYPE = linux* ]] && ifile=/usr/include/bits/syscall.h
-syscalls=( ${${${(M)${(f)"$(<$ifile)"}:#?define[[:blank:]]##SYS_*}#*[[:blank:]]SYS_}%%[[:blank:]]*} ) 2>/dev/null
+syscalls=( ${${${(M)${(f)"$(<$ifile)"}:#\#[[:blank:]]#define[[:blank:]]##SYS_*}#*[[:blank:]]SYS_}%%[[:blank:]]*} ) 2>/dev/null
 [[ -n $all ]] && syscalls+=( all )
 [[ -n $none ]] && syscalls+=( none )
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-20 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 17:11 [PATCH] _sys_calls: analyze recent syscall.h properly Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).