Allow comments in config files.

This commit is contained in:
Roger A. Light
2014-05-25 11:07:01 +01:00
parent 7e410eb7f0
commit 0bbdda2c4e
3 changed files with 8 additions and 2 deletions
+2
View File
@@ -92,6 +92,8 @@ int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *
fptr = fopen(loc, "rt");
if(fptr){
while(fgets(line, 1024, fptr)){
if(line[0] == '#') continue; /* Comments */
while(line[strlen(line)-1] == 10 || line[strlen(line)-1] == 13){
line[strlen(line)-1] = 0;
}