diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc index 848a122b..4a14d64e 100644 --- a/syntax/makefile.nanorc +++ b/syntax/makefile.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for Makefiles. -syntax makefile "(/((GNU)?m|M)akefile[^/]*$|\.(make|mk)$)" +syntax makefile "(^|/)((GNU)?m|M)akefile[^/]*$|\.(make|mk)$" magic "makefile script" tabgives " " diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc index 3a5473d1..bf15d44a 100644 --- a/syntax/sh.nanorc +++ b/syntax/sh.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for Bourne shell scripts. -syntax sh "(\.sh|(\.|/)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|/(etc/|\.)profile)$" +syntax sh "(\.sh|(^|/|\.)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|(/etc/|(^|/)\.)profile)$" header "^#!.*/((env[[:blank:]]+)?((a|ba|c|da|k|mk|pdk|tc|z)?sh)|busybox[[:blank:]]+sh|openrc-run|runscript)\>" header "-\*-.*shell-script.*-\*-" magic "(POSIX|Bourne-Again) shell script.*text"