Don't add spaces to the start of #define data.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 17 Feb 2009 08:40:34 -0500
changeset 643 20403ca72f54
parent 642 624ab8696f9b
child 644 ea8b50a4edaf
Don't add spaces to the start of #define data.
mojoshader_preprocessor.c
--- a/mojoshader_preprocessor.c	Tue Feb 17 08:40:03 2009 -0500
+++ b/mojoshader_preprocessor.c	Tue Feb 17 08:40:34 2009 -0500
@@ -899,8 +899,11 @@
                 break;
 
             case ((Token) ' '):  // may not actually point to ' '.
-                if (!add_to_buffer(&buffer, &space, 1, m, d))
-                    ctx->out_of_memory = 1;
+                if (buffer.total_bytes > 0)
+                {
+                    if (!add_to_buffer(&buffer, &space, 1, m, d))
+                        ctx->out_of_memory = 1;
+                } // if
                 break;
 
             default: