mirror of https://github.com/omar-polo/gmid.git
const-ify strings in struct location
This commit is contained in:
parent
0cd6675437
commit
fe5967cd02
8
gmid.h
8
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 */
|
||||
};
|
||||
|
||||
|
|
9
parse.y
9
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; }
|
||||
|
|
Loading…
Reference in New Issue