Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
format
[simgrid.git] / tools / tesh / tesh.c
index 1b3e1fb..4cf55b9 100644 (file)
@@ -6,6 +6,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid_config.h"     /* FILE for getline */
+
 /* specific to Borland Compiler */
 #ifdef __BORLANDDC__
 #pragma hdrstop
@@ -85,12 +87,12 @@ static void handle_line(const char *filepos, char *line)
 static void handle_suite(const char *filename, FILE * IN)
 {
   size_t len;
-  int blankline = 1;
-  int linelen = 0;
+  int blankline;
+  int linelen;
   char *line = NULL;
   int line_num = 0;
   char file_pos[256];
-  int to_be_continued = 0;
+  int to_be_continued;
   int buffbegin = 0;
   xbt_strbuff_t buff = NULL;
 
@@ -101,6 +103,8 @@ static void handle_suite(const char *filename, FILE * IN)
     line_num++;
 
     /* Count the line length while checking wheather it's blank */
+    blankline = 1;
+    linelen = 0;
 
     while (line[linelen] != '\0') {
       if (line[linelen] != ' ' && line[linelen] != '\t'
@@ -123,6 +127,7 @@ static void handle_suite(const char *filename, FILE * IN)
     }
 
     /* Deal with \ at the end of the line, and call handle_line on result */
+    to_be_continued = 0;
     if (linelen > 1 && line[linelen - 2] == '\\') {
       if (linelen > 2 && line[linelen - 3] == '\\') {
         /* Damn. Escaped \ */