Skip to content

Commit

Permalink
don't allow uris inside ${ ... } blocks
Browse files Browse the repository at this point in the history
this fixes NixOS#1017
evaluating `nix-env -qa` and (modulo some typo problem) this doesn't seem to be used inside nixpkgs.
this is a non-backward-compatible change though, 3rd party code could break because of this.
  • Loading branch information
fkz committed Aug 9, 2016
1 parent c8608c4 commit 141d131
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libexpr/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ or { return OR_KW; }
}
<IND_STRING>. return yytext[0]; /* just in case: shouldn't be reached */

<INITIAL>{URI} { yylval->uri = strdup(yytext); return URI; }

<INITIAL,INSIDE_DOLLAR_CURLY>{

{PATH} { yylval->path = strdup(yytext); return PATH; }
{HPATH} { yylval->path = strdup(yytext); return HPATH; }
{SPATH} { yylval->path = strdup(yytext); return SPATH; }
{URI} { yylval->uri = strdup(yytext); return URI; }

[ \t\r\n]+ /* eat up whitespace */
\#[^\r\n]* /* single-line comments */
Expand Down

0 comments on commit 141d131

Please sign in to comment.