summaryrefslogtreecommitdiffstats
path: root/common/file.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-04-25 00:19:14 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-04-25 00:19:14 -0700
commit8acdc403e3105274641c225a11129e529e7ae667 (patch)
tree58dd9aae44f14b6c042976d6145744f42d164ef5 /common/file.c
parent1f1b6e873813f5cb7ce443b46675008c157d5da0 (diff)
downloadxrdp-proprietary-8acdc403e3105274641c225a11129e529e7ae667.tar.gz
xrdp-proprietary-8acdc403e3105274641c225a11129e529e7ae667.zip
common: fix for when [] is in comment
Diffstat (limited to 'common/file.c')
-rw-r--r--common/file.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/common/file.c b/common/file.c
index c8be7af5..05f243ca 100644
--- a/common/file.c
+++ b/common/file.c
@@ -242,8 +242,19 @@ l_file_read_section(int fd, int max_file_size, const char *section,
for (index = 0; index < len; index++)
{
+ if (!s_check_rem(s, 1))
+ {
+ break;
+ }
in_uint8(s, c);
-
+ if ((c == '#') || (c == ';'))
+ {
+ file_read_line(s, text);
+ in_it = 0;
+ in_it_index = 0;
+ g_memset(text, 0, 512);
+ continue;
+ }
if (c == '[')
{
in_it = 1;
@@ -253,7 +264,6 @@ l_file_read_section(int fd, int max_file_size, const char *section,
if (g_strcasecmp(section, text) == 0)
{
file_read_line(s, text);
-
while (file_read_line(s, text) == 0)
{
if (g_strlen(text) > 0)
@@ -296,7 +306,6 @@ l_file_read_section(int fd, int max_file_size, const char *section,
}
}
}
-
free_stream(s);
return 1;
}