diff --git a/main/config.c b/main/config.c
index f1bcd1896bb79964f9804acdd36f103e81be8d84..8cd1194e8306df2a1f7bfb9970f2e0a470e28667 100644
--- a/main/config.c
+++ b/main/config.c
@@ -905,7 +905,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
 							new_buf = comment_p + 1;
 					}
 				}
-				if( comment && !process_buf )
+				if( withcomments && comment && !process_buf )
 				{
 					CB_ADD(buf);  /* the whole line is a comment, store it */
 				}