aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-27 15:53:30 +0000
committerOmar Polo <op@omarpolo.com>2021-01-27 15:53:30 +0000
commitfe5967cd02fce0a3b5db0dc4f05ff342083ba1d0 (patch)
treee8baefc5bc3c8d0576159b51272c2a4ba78e56ab /parse.y
parent0cd6675437e580ae2ac585d6b0bff325990cf8b8 (diff)
const-ify strings in struct location
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 6 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 56a3935..b626c1b 100644
--- a/parse.y
+++ b/parse.y
@@ -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; }