X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/bb4fc0a9e4e105a13b3a032b28802a84523fc506..5c4d7f0764f99ebe6e65933b1bc08671dbab98e9:/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();