From 29684dd800bd753bc4b9d3b3e0507360f391a2f7 Mon Sep 17 00:00:00 2001
From: George Bosilca <bosilca@icl.utk.edu>
Date: Thu, 19 Jan 2006 15:52:17 +0000
Subject: [PATCH] Remove a warning about an unused variable.

This commit was SVN r8755.
---
 opal/mca/base/mca_base_param.c | 37 +++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/opal/mca/base/mca_base_param.c b/opal/mca/base/mca_base_param.c
index 2e2b62f734..9fcf86b1f5 100644
--- a/opal/mca/base/mca_base_param.c
+++ b/opal/mca/base/mca_base_param.c
@@ -761,7 +761,7 @@ int mca_base_param_finalize(void)
 
 static int read_files(char *file_list)
 {
-    int i, index, count;
+    int i, count;
     char **files;
 
     /* Iterate through all the files passed in -- read them in reverse
@@ -774,24 +774,29 @@ static int read_files(char *file_list)
 #ifdef __WINDOWS__
     /* Windows use : as a delimiter between the drive name and the path
      * Hopefuly, the drive name is limitted to one letter, so we can parse
-     * the files array as merge all of them.
+     * the files array and merge all one letter char* with the next. I hope
+     * nobody plan to have a one letter path on UNIX.
      */
-    for( index = i = 0; i < count; i++ ) {
-        if( (1 == strlen(files[i])) && (isalpha(files[i][0])) ) {
-            int length = 4 + strlen(files[i+1]);
-            char* temp = (char*)malloc( length );
-            snprintf( temp, length, "%s:%s", files[i], files[i+1] );
-            temp[3+strlen(files[i+1])] = '\0';
-            free(files[i]);
-            free(files[i+1]);
-            files[index++] = temp;
-            i++;
-        } else {
-            files[index++] = files[i];
+    {
+        int index;
+
+        for( index = i = 0; i < count; i++ ) {
+            if( (1 == strlen(files[i])) && (isalpha(files[i][0])) ) {
+                int length = 4 + strlen(files[i+1]);
+                char* temp = (char*)malloc( length );
+                snprintf( temp, length, "%s:%s", files[i], files[i+1] );
+                temp[3+strlen(files[i+1])] = '\0';
+                free(files[i]);
+                free(files[i+1]);
+                files[index++] = temp;
+                i++;
+            } else {
+                files[index++] = files[i];
+            }
         }
+        count = index;
+        files[index] = NULL;  /* force the final NULL */
     }
-    count = index;
-    files[index] = NULL;
 #endif
 
     for (i = count - 1; i >= 0; --i) {