bugGNU source-highlight - Bugs: bug #56602, Invalid keyword in zsh.lang causes...

 
 

bug #56602: Invalid keyword in zsh.lang causes infinite loop

Submitted by:  Vic Hanson <macseti>
Submitted on:  Tue 09 Jul 2019 05:30:11 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 27 Jul 2019 04:21:44 PM UTC, comment #1: 

Thank you for the report.

This has been fixed in git since June 2.
I hope to do a new release sometime this summer.

Meanwhile, I'm closing this bug.

Tom Tromey <tromey>
Project Administrator
Tue 09 Jul 2019 05:30:11 PM UTC, original submission:  

System:
Mac OS 17.7.0 Darwin Kernel Version 17.7.0: Wed Apr 24 21:17:24 PDT 2019; root:xnu-4570.71.45~1/RELEASE_X86_64 i386

Software:
source-highlight --version
GNU Source-highlight 3.1.8 (library: 4:1:0)

source-highlight --failsafe --infer-lang --debug-langdef=interactive -f esc -v -i bzr.zsh
retrieving default datadir value...
using datadir value from conf file /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight
opening ./outlang.map
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/outlang.map
inferring input language...
couldn't infer input language
opening ./lang.map
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/lang.map
opening ./esc.outlang
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/esc.outlang
opening ./default.style
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/default.style
opening ./style.defaults
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/style.defaults
opening ./zsh.lang
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/zsh.lang
opening ./number.lang
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/number.lang
opening ./script_comment.lang
opening /usr/local/Cellar/source-highlight/3.1.8_12/share/source-highlight/script_comment.lang
zsh.lang:21
expression: "(?:alias|always|autoload|bg|bindkey|break|builtin|bye|cap|case|cd|chdir|clone|command|comparguments|compcall|compctl|compdescribe|compfiles|compgroups|compquote|comptags|comptry|compvalues|continue|declare|dirs|disable|disown|do|echo|echotc|echoti|elif|else|emulate|enable|esac|eval|exec|exec|exit|export|false|fc|fg|fi|float|for|foreach|function|functions|getcap|getln|getopts|hash|history|if|in|integer|jobs|kill|let|limit|local|log|logout|nocorrect|noglob|none|popd|print|printf|pushd|pushln|pwd|r|read|readonly|rehash|repeat|return|sched|select|set|setcap|setopt|shift|source|stat|suspend|test|then|time|times|trap|true|ttyctl|type|typeset|ulimit|umask|unalias|unfunction|unhash|unlimit|unset|unsetopt|until|vared|wait|whence|where|which|while|zcompile|zformat|zftp|zle|zmodload|zparseopts|zprof|zpty|zregexparse|zsocket|zstyle|ztcp|)"
formatting "" as keyword

The infinite loop outputs the above starting from zsh.lang:21.

Suggested fix is to remove the final | from the keyword array. Saved original, showing diff below.

diff zsh.lang.orig zsh.lang
38c38
<           "zsocket|zstyle|ztcp|"
---

>           "zsocket|zstyle|ztcp"

50a51
<

This solved the infinite loop. Thanks!

Vic Hanson
-email is unavailable-

"No, no, you are not thinking, you are just being logical." - Neil Bohr

Vic Hanson <macseti>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47177:  zsh.lang added by macseti (2KiB - application/octet-stream - Included original and fixed zsh.lang files)
file #47178:  zsh.lang.orig added by macseti (2KiB - application/octet-stream - Included original and fixed zsh.lang files)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tromey (Posted a comment)
  • -email is unavailable- added by macseti (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-27 tromey StatusNone => Fixed
        Open/ClosedOpen => Closed
    2019-07-09 macseti Attached File- => Added zsh.lang, #47177
        Attached File- => Added zsh.lang.orig, #47178

    Back to the top


    Powered by Savane 3.5