OSDN Git Service

Eliminate invalid comparisons of "this" with nullptr.
[mingw/mingw-get.git] / src / climain.cpp
index c2f1f16..9230526 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
+ * Copyright (C) 2009-2013, MinGW.org Project
  *
  *
  * Implementation of the main program function, which is invoked by
@@ -223,7 +223,7 @@ EXTERN_C int climain( int argc, char **argv )
        /* ...initialise any preferences which the user may
         * have specified within profile.xml...
         */
-       dbase.EstablishPreferences();
+       dbase.EstablishPreferences( "cli" );
 
        /* ...and invoke the appropriate action handler.
         */
@@ -403,27 +403,21 @@ void pkgActionItem::GetScheduledSourceArchives( unsigned long category )
    * for the case when the "--all-related" option is in effect for a
    * "source" or "licence" request.
    */
-  if( this != NULL )
+  pkgActionItem *scheduled = this;
+  while( scheduled->prev != NULL ) scheduled = scheduled->prev;
+
+  /* For each scheduled list entry...
+   */
+  while( scheduled != NULL )
   {
-    /* The package list is NOT empty; ensure that we begin with
-     * a reference to its first entry.
+    /* ...process the "source" or "licence" request, as appropriate,
+     * in respect of the associated package...
      */
-    pkgActionItem *scheduled = this;
-    while( scheduled->prev != NULL ) scheduled = scheduled->prev;
-
-    /* For each scheduled list entry...
+    scheduled->GetSourceArchive( scheduled->Selection(), category );
+    /*
+     * ...then move on to the next entry, if any.
      */
-    while( scheduled != NULL )
-    {
-      /* ...process the "source" or "licence" request, as appropriate,
-       * in respect of the associated package...
-       */
-      scheduled->GetSourceArchive( scheduled->Selection(), category );
-      /*
-       * ...then move on to the next entry, if any.
-       */
-      scheduled = scheduled->next;
-    }
+    scheduled = scheduled->next;
   }
 }