Browse code

clambc: bb#11101 - no longer parses logical signature as source in certain conditions

Kevin Lin authored on 2014/09/10 23:51:46
Showing 1 changed files
... ...
@@ -133,7 +133,7 @@ static uint8_t debug_flag = 0;
133 133
 static void print_src(const char *file)
134 134
 {
135 135
   char buf[4096];
136
-  int nread, i, found = 0;
136
+  int nread, i, found = 0, lcnt = 0;
137 137
   FILE *f = fopen(file, "r");
138 138
   if (!f) {
139 139
     fprintf(stderr,"Unable to reopen %s\n", file);
... ...
@@ -142,7 +142,11 @@ static void print_src(const char *file)
142 142
   do {
143 143
     nread = fread(buf, 1, sizeof(buf), f);
144 144
     for (i=0;i<nread-1;i++) {
145
-      if (buf[i] == '\n' && buf[i+1] == 'S') {
145
+      if (buf[i] == '\n') {
146
+        lcnt++;
147
+      }
148
+      /* skip over the logical trigger */
149
+      if (lcnt >= 2 && buf[i] == '\n' && buf[i+1] == 'S') {
146 150
         found = 1;
147 151
         i+=2;
148 152
         break;