From: Arch Librarian <arch@canonical.com>
Date: Mon, 20 Sep 2004 16:54:30 +0000 (+0000)
Subject: Fixed strange seg on sparc
X-Git-Tag: 0.7.24ubuntu1~1284
X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/8508b1df3743c016f3f3aa82d63672378a113cac

Fixed strange seg on sparc
Author: jgg
Date: 1999-08-04 05:37:18 GMT
Fixed strange seg on sparc
---

diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc
index f16843c61..556b8869b 100644
--- a/cmdline/acqprogress.cc
+++ b/cmdline/acqprogress.cc
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acqprogress.cc,v 1.16 1999/07/03 03:10:35 jgg Exp $
+// $Id: acqprogress.cc,v 1.17 1999/08/04 05:37:18 jgg Exp $
 /* ######################################################################
 
    Acquire Progress - Command line progress meter 
@@ -12,6 +12,7 @@
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire-worker.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/error.h>
 
 #include <stdio.h>
 #include <signal.h>
@@ -124,7 +125,7 @@ void AcqTextStatus::Stop()
    if (Quiet <= 0)
       cout << '\r' << BlankLine << '\r';
    
-   if (FetchedBytes != 0)
+   if (FetchedBytes != 0 && _error->PendingError() == false)
       cout << "Fetched " << SizeToStr(FetchedBytes) << "B in " <<
          TimeToStr(ElapsedTime) << " (" << SizeToStr(CurrentCPS) << 
          "B/s)" << endl;
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 1ee47e8c4..18888b4d9 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.71 1999/07/12 04:39:37 jgg Exp $
+// $Id: apt-get.cc,v 1.72 1999/08/04 05:37:18 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -413,12 +413,8 @@ void Stats(ostream &out,pkgDepCache &Dep)
 pkgCache *CacheFile::SortCache = 0;
 int CacheFile::NameComp(const void *a,const void *b)
 {
-   if (a == 0 && b == 0)
-      return 0;
-   if (a == 0)
-      return -1;
-   if (b == 0)
-      return 1;
+   if (*(pkgCache::Package **)a == 0 || *(pkgCache::Package **)b == 0)
+      return *(pkgCache::Package **)a - *(pkgCache::Package **)b;
    
    const pkgCache::Package &A = **(pkgCache::Package **)a;
    const pkgCache::Package &B = **(pkgCache::Package **)b;