]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cache.cc
* merged with apt--debian-sid--0
[apt.git] / cmdline / apt-cache.cc
index 94cfab14f743ad10d20103b813fa74a9632c73a4..cb1aeb514f4184ffb55479765bc89e62da27c8c9 100644 (file)
@@ -1229,7 +1229,7 @@ bool DisplayRecord(pkgCache::VerIterator V)
    const unsigned char *DescP = (unsigned char*)strstr((char*)Buffer, "Description:");
 
    // Write all but Description
-   if (fwrite(Buffer,1,DescP - Buffer-1,stdout) < (size_t)(DescP - Buffer-1))
+   if (fwrite(Buffer,1,DescP - Buffer,stdout) < (size_t)(DescP - Buffer))
    {
       delete [] Buffer;
       return false;
@@ -1237,13 +1237,7 @@ bool DisplayRecord(pkgCache::VerIterator V)
 
    // Show the right description
    pkgRecords Recs(*GCache);
-   pkgCache::DescIterator DescDefault = V.DescriptionList();
-   pkgCache::DescIterator Desc = DescDefault;
-   for (; Desc.end() == false; Desc++)
-      if (pkgIndexFile::LanguageCode() == Desc.LanguageCode())
-        break;
-   if (Desc.end() == true) Desc = DescDefault;
-
+   pkgCache::DescIterator Desc = V.TranslatedDescription();
    pkgRecords::Parser &P = Recs.Lookup(Desc.FileList());
    cout << "Description" << ( (strcmp(Desc.LanguageCode(),"") != 0) ? "-" : "" ) << Desc.LanguageCode() << ": " << P.LongDesc();