c3program: Include digits in uniform names
authorMichel Pollet <buserror@gmail.com>
Sat, 16 Jun 2012 08:09:45 +0000 (09:09 +0100)
committerMichel Pollet <buserror@gmail.com>
Sat, 16 Jun 2012 08:09:45 +0000 (09:09 +0100)
Somehow they were missing

Signed-off-by: Michel Pollet <buserror@gmail.com>
examples/shared/libc3/src/c3program.c

index 86e4404..f045de8 100644 (file)
@@ -144,14 +144,14 @@ c3program_load_shader(
                        char * sep = line->str;
                        char * uniform = strsep(&sep, " \t");
                        char * unitype = strsep(&sep, " \t");
-                       char * uniname = strsep(&sep, " \t");
+                       char * uniname = strsep(&sep, " \t=;");
                        /*
                         * found a parameter, extract it's type & name
                         */
                        if (uniform && unitype && uniname) {
                                // trim semicolons etc
                                char *cl = uniname;
-                               while (isalpha(*cl) || *cl == '_')
+                               while (isalpha(*cl) || *cl == '_' || isdigit(*cl))
                                        cl++;
                                *cl = 0;
                                str_p name = str_new(uniname);