Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 7370)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 7371)
@@ -63,5 +63,5 @@
 
   PRINTF(5)("AutoComplete on input\n");
-  this->emptyCompletionList();
+  this->clearCompletionList();
 
   // Check if we are in a input. eg. the supplied string "class " and now we complete either function or object
@@ -135,5 +135,5 @@
   if (clList != NULL)
   {
-    if (!this->addToCompleteList(clList, classBegin, SHELLC_CLASS))
+    if (!this->addToCompleteList(*clList, classBegin, SHELLC_CLASS))
       return false;
   }
@@ -157,5 +157,5 @@
     if (classID == CL_SHELL_COMMAND_CLASS)
       type = SHELLC_CLASS;
-    if (!this->addToCompleteList(boList, objectBegin, type))
+    if (!this->addToCompleteList(*boList, objectBegin, type))
       return false;
   }
@@ -175,5 +175,5 @@
   ShellCommandClass::getCommandListOfClass(className, &fktList);
   //printf("%s\n", boList->firstElement()->getName());
-  if (!this->addToCompleteList(&fktList, functionBegin, SHELLC_FUNCTION))
+  if (!this->addToCompleteList(fktList, functionBegin, SHELLC_FUNCTION))
     return false;
   return true;
@@ -190,5 +190,5 @@
   ShellCommandClass::getCommandListOfAlias(&aliasList);
   //printf("%s\n", boList->firstElement()->getName());
-  if (!this->addToCompleteList(&aliasList, aliasBegin, SHELLC_ALIAS))
+  if (!this->addToCompleteList(aliasList, aliasBegin, SHELLC_ALIAS))
     return false;
   return true;
@@ -265,18 +265,17 @@
  * !! The strings MUST NOT be deleted !!
  */
-bool ShellCompletion::addToCompleteList(const std::list<std::string>* inputList, const std::string& completionBegin, SHELLC_TYPE type)
-{
-  if (inputList == NULL)
-    return false;
+bool ShellCompletion::addToCompleteList(const std::list<std::string>& inputList, const std::string& completionBegin, SHELLC_TYPE type)
+{
   unsigned int searchLength = completionBegin.size();
 
-  list<std::string>::const_iterator string;
-  for (string = inputList->begin(); string != inputList->end(); string++)
+  std::list<std::string>::const_iterator string;
+  for (string = inputList.begin(); string != inputList.end(); string++)
   {
     if ((*string).size() >= searchLength &&
-          !strncasecmp((*string).c_str(), completionBegin.c_str(), searchLength))
+          !nocaseCmp(*string, completionBegin, searchLength))
     {
+      printf ("%s\n", (*string).c_str());
       ShellC_Element newElem;
-      newElem.name = (*string).c_str();
+      newElem.name = (*string);
       newElem.type = type;
       this->completionList.push_back(newElem);
@@ -292,16 +291,14 @@
  * !! The strings MUST NOT be deleted !!
  */
-bool ShellCompletion::addToCompleteList(const std::list<BaseObject*>* inputList, const std::string& completionBegin, SHELLC_TYPE type)
-{
-  if (inputList == NULL)
-    return false;
+bool ShellCompletion::addToCompleteList(const std::list<BaseObject*>& inputList, const std::string& completionBegin, SHELLC_TYPE type)
+{
   unsigned int searchLength = completionBegin.size();
 
-  list<BaseObject*>::const_iterator bo;
-  for(bo = inputList->begin(); bo != inputList->end(); bo++)
+  std::list<BaseObject*>::const_iterator bo;
+  for(bo = inputList.begin(); bo != inputList.end(); bo++)
   {
     if ((*bo)->getName() != NULL &&
         strlen((*bo)->getName()) >= searchLength &&
-          !strncasecmp((*bo)->getName(), completionBegin.c_str(), searchLength))
+          !nocaseCmp((*bo)->getName(), completionBegin, searchLength))
     {
       ShellC_Element newElem;
@@ -320,5 +317,5 @@
  * This is done at the beginning of each completion-run
  */
-void ShellCompletion::emptyCompletionList()
+void ShellCompletion::clearCompletionList()
 {
   this->completionList.clear();
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 7370)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 7371)
@@ -20,21 +20,22 @@
 #endif
 
-//! an enumerator for different types the Shell can complete.
-typedef enum {
-  SHELLC_NONE        = 0,
-  SHELLC_CLASS       = 1,
-  SHELLC_OBJECT      = 2,
-  SHELLC_FUNCTION    = 4,
-  SHELLC_ALIAS       = 8,
-} SHELLC_TYPE;
-
-//! A struct for ShellElements (these are used as containers to identify an Input for what it is)
-struct ShellC_Element{
-  std::string     name;     //!< the Name of the Element to be completed.
-  SHELLC_TYPE     type;     //!< the type of the Element
-};
 
 //! A class for ...
 class ShellCompletion {
+
+  //! an enumerator for different types the Shell can complete.
+  typedef enum {
+    SHELLC_NONE        = 0,
+    SHELLC_CLASS       = 1,
+    SHELLC_OBJECT      = 2,
+    SHELLC_FUNCTION    = 4,
+    SHELLC_ALIAS       = 8,
+  } SHELLC_TYPE;
+
+//! A struct for ShellElements (these are used as containers to identify an Input for what it is)
+  struct ShellC_Element{
+    std::string     name;     //!< the Name of the Element to be completed.
+    SHELLC_TYPE     type;     //!< the type of the Element
+  };
 
  public:
@@ -55,7 +56,8 @@
                        const std::string& addBack = "", const std::string& addFront = "");
 
-  bool addToCompleteList(const std::list<std::string>* inputList, const std::string& completionBegin, SHELLC_TYPE type);
-  bool addToCompleteList(const std::list<BaseObject*>* inputList, const std::string& completionBegin, SHELLC_TYPE type);
-  void emptyCompletionList();
+
+  bool addToCompleteList(const std::list<std::string>& inputList, const std::string& completionBegin, SHELLC_TYPE type);
+  bool addToCompleteList(const std::list<BaseObject*>& inputList, const std::string& completionBegin, SHELLC_TYPE type);
+  void clearCompletionList();
 
   static const char* ShellCompletion::typeToString(SHELLC_TYPE type);
Index: /trunk/src/lib/util/helper_functions.cc
===================================================================
--- /trunk/src/lib/util/helper_functions.cc	(revision 7370)
+++ /trunk/src/lib/util/helper_functions.cc	(revision 7371)
@@ -115,5 +115,5 @@
  * @param s2 second string
  */
-int nocase_cmp(const std::string& s1, const std::string& s2)
+int nocaseCmp(const std::string& s1, const std::string& s2)
 {
   std::string::const_iterator it1=s1.begin();
@@ -137,2 +137,27 @@
 }
 
+
+/**
+ * @brief compares two strings without ignoring the case
+ * @param s1 first string
+ * @param s2 second string
+ * @param len how far from the beginning to start.
+ */
+int nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len)
+{
+  std::string::const_iterator it1=s1.begin();
+  std::string::const_iterator it2=s2.begin();
+
+  //stop when either string's end has been reached
+  while ( (it1!=s1.end()) && (it2!=s2.end()) && len-- > 0)
+  {
+    if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
+     // return -1 to indicate smaller than, 1 otherwise
+      return (::toupper(*it1)  < ::toupper(*it2)) ? -1 : 1;
+    //proceed to the next character in each string
+    ++it1;
+    ++it2;
+  }
+  return 0;
+}
+
Index: /trunk/src/lib/util/helper_functions.h
===================================================================
--- /trunk/src/lib/util/helper_functions.h	(revision 7370)
+++ /trunk/src/lib/util/helper_functions.h	(revision 7371)
@@ -21,5 +21,6 @@
 
 
-int           nocase_cmp(const std::string& s1, const std::string& s2);
+int           nocaseCmp(const std::string& s1, const std::string& s2);
+int           nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len);
 
 
