Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue #21 - Assertion while reading redis.conf with UTF-8 BOM

  • Loading branch information...
commit e52ee6ab8c76254415dbcae5529c10f3d3748e05 1 parent ae7df81
@HenryRawas HenryRawas authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/config.c
View
7 src/config.c
@@ -48,6 +48,13 @@ void loadServerConfig(char *filename) {
}
}
+ if (fread(buf, 1, 3, fp) == 3) {
+ /* if BOM for UTF-8 skip over it, else seek to 0 */
+ if (buf[0] != (char)0xEF || buf[1] != (char)0xBB || buf[2] != (char)0xBF) {
+ fseek(fp, 0, SEEK_SET);
+ }
+ }
+
while(fgets(buf,REDIS_CONFIGLINE_MAX+1,fp) != NULL) {
sds *argv;
int argc, j;
Please sign in to comment.
Something went wrong with that request. Please try again.