X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/80ada697b4aae3d41ba85fa365ee9b8b77387f06..facac1c52ebe40656af693502cab66eb4c09ad2f:/cmdline/apt-cache.cc diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 94cfab14f..cb1aeb514 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -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();