Commit Diff


commit - 0cd6675437e580ae2ac585d6b0bff325990cf8b8
commit + fe5967cd02fce0a3b5db0dc4f05ff342083ba1d0
blob - 1fcce777455a1b6f8d5948bd3c9616f6d26c1591
blob + 9e1eac56d82e945e73c31d808b036798188bf323
--- gmid.h
+++ gmid.h
@@ -64,10 +64,10 @@
 #define LOGD(c, fmt, ...) logs(LOG_DEBUG,   c, fmt, __VA_ARGS__)
 
 struct location {
-	char		*match;
-	char		*lang;
-	char		*default_mime;
-	char		*index;
+	const char	*match;
+	const char	*lang;
+	const char	*default_mime;
+	const char	*index;
 	int		 auto_index; /* 0 auto, -1 off, 1 on */
 };
 
blob - 56a393577063eca8a92d8c78bb7c85f1941e56bd
blob + b626c1b676ead5fe5f4ee6a82f8b64a3142d3f50
--- parse.y
+++ 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; }