Index: src/fortranscanner.l
===================================================================
--- src/fortranscanner.l	(revision 813)
+++ src/fortranscanner.l	(working copy)
@@ -196,7 +196,7 @@
 static void startCommentBlock(bool);
 static void handleCommentBlock(const QCString &doc,bool brief);
 static void subrHandleCommentBlock(const QCString &doc,bool brief);
-static void addCurrentEntry();
+static void addCurrentEntry(int case_insens);
 static void addModule(const char *name, bool isModule=FALSE);
 static void addSubprogram(const char *text);
 static void addInterface(QCString name, InterfaceType type);
@@ -490,7 +490,7 @@
                                           current->section = Entry::FUNCTION_SEC ;
                                           current->name = yytext; 
                                           moduleProcedures.append(current);
-                                          addCurrentEntry();
+                                          addCurrentEntry(1);
                                         }
 <ModuleProcedure>"\n"                   { yyColNr -= 1;
 					  unput(*yytext); 
@@ -608,7 +608,7 @@
                                             current->name = current_root->name + "::" + current->name;
                                           }
 
-                                          addCurrentEntry();
+                                          addCurrentEntry(1);
                                           startScope(last_entry); 
                                           BEGIN(TypedefBody);
                                         }
@@ -639,7 +639,7 @@
                                           current->name     = name;
                                           current->fileName = yyFileName;
                                           current->bodyLine = yyLineNr;
-                                          addCurrentEntry();
+                                          addCurrentEntry(1);
                                         }
 {BS}"=>"[^(\n|\!)]*                     { /* Specific bindings come after the ID. */
                                           last_entry->args = yytext;
@@ -781,7 +781,7 @@
 					    current->type = argType;
 					    current->fileName = yyFileName;
 					    current->bodyLine  = yyLineNr; // used for source reference
-                                            addCurrentEntry();
+                                            addCurrentEntry(1);
                                           } 
 					  else if (!argType.isEmpty())
 					  { // declaration of parameter list: add type for corr. parameter 
@@ -977,7 +977,7 @@
 <Parameterlist>")"                     {
 				         current->args += ")";
 				         current->args = removeRedundantWhiteSpace(current->args);
-                                         addCurrentEntry();
+                                         addCurrentEntry(1);
 					 startScope(last_entry);
 					 BEGIN(SubprogBody);
 				       }
@@ -1003,7 +1003,7 @@
 				           newLine();
 					   //printf("3=========> without parameterlist \n");
  					   //current->argList = ;
-                                           addCurrentEntry();
+                                           addCurrentEntry(1);
 					   startScope(last_entry);
 					   BEGIN(SubprogBody);				           
 }
@@ -1891,10 +1891,10 @@
 /**
   adds current entry to current_root and creates new current
 */
-static void addCurrentEntry()
+static void addCurrentEntry(int case_insens)
 {
+  if (case_insens) current->name = current->name.lower();
   //printf("===Adding entry %s to %s\n", current->name.data(), current_root->name.data());
-  current->name = current->name.lower();
   current_root->addSubEntry(current);
   last_entry = current;
   current = new Entry ;
@@ -1928,7 +1928,7 @@
   current->fileName  = yyFileName;
   current->bodyLine  = yyLineNr; // used for source reference
   current->protection = Public ;
-  addCurrentEntry();
+  addCurrentEntry(1);
   startScope(last_entry);
 }
 
@@ -1992,7 +1992,7 @@
 
   current->fileName = yyFileName;
   current->bodyLine  = yyLineNr; 
-  addCurrentEntry();
+  addCurrentEntry(1);
 }
 
 
@@ -2060,11 +2060,11 @@
         )) 
   {
 	   //fprintf(stderr,"parseCommentBlock position=%d [%s]  needsEntry=%d\n",position,doc.data()+position,needsEntry);
-   if (needsEntry) addCurrentEntry();
+   if (needsEntry) addCurrentEntry(0);
   }
   //fprintf(stderr,"parseCommentBlock position=%d [%s]  needsEntry=%d\n",position,doc.data()+position,needsEntry);
 
-  if (needsEntry) addCurrentEntry();
+  if (needsEntry) addCurrentEntry(0);
 }
 
 //----------------------------------------------------------------------------
