aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glcpp/pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/glcpp/pp.c')
-rw-r--r--mesalib/src/glsl/glcpp/pp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesalib/src/glsl/glcpp/pp.c b/mesalib/src/glsl/glcpp/pp.c
index 789f7f941..7e1b6c689 100644
--- a/mesalib/src/glsl/glcpp/pp.c
+++ b/mesalib/src/glsl/glcpp/pp.c
@@ -97,8 +97,10 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
{
ralloc_strncat(&clean, shader,
newline - shader + 1);
- while (collapsed_newlines--)
+ while (collapsed_newlines) {
ralloc_strcat(&clean, "\n");
+ collapsed_newlines--;
+ }
shader = newline + 1;
search_start = shader;
}