Skip to content

Commit 64e013e

Browse files
authored
Merge pull request #35 from slack-uj/patch-1
Update c_remove_comments.c
2 parents 1abeacd + bf2bbf2 commit 64e013e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

chapter_1/exercise_1_23/c_remove_comments.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ void remove_comments(char str[], char no_com_str[])
5252
int i = 0, j = 0;
5353
while (str[i] != '\0')
5454
{
55-
if (!in_quote && str[i] == '"')
55+
if (!block_comment)
56+
{
57+
if (!in_quote && str[i] == '"')
5658
{
5759
in_quote = TRUE;
5860
}
5961
else if (in_quote && str[i] == '"')
6062
{
6163
in_quote = FALSE;
6264
}
65+
}
6366

6467
if (!in_quote)
6568
{

0 commit comments

Comments
 (0)