diff options
author | Omar Polo <op@omarpolo.com> | 2021-01-27 15:53:30 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-01-27 15:53:30 +0000 |
commit | fe5967cd02fce0a3b5db0dc4f05ff342083ba1d0 (patch) | |
tree | e8baefc5bc3c8d0576159b51272c2a4ba78e56ab /parse.y | |
parent | 0cd6675437e580ae2ac585d6b0bff325990cf8b8 (diff) |
const-ify strings in struct location
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -129,15 +129,18 @@ locopts : /* empty */ ; locopt : TDEFAULT TTYPE TSTRING { - free(loc->default_mime); + if (loc->default_mime != NULL) + yyerror("`default type' specified more than once"); loc->default_mime = $3; } | TLANG TSTRING { - free(loc->lang); + if (loc->lang != NULL) + yyerror("`lang' specified more than once"); loc->lang = $2; } | TINDEX TSTRING { - free(loc->index); + if (loc->index != NULL) + yyerror("`index' specified more than once"); loc->index = $2; } | TAUTO TINDEX TBOOL { loc->auto_index = $3 ? 1 : -1; } |