Browse Source

* apt-pkg/deb/dpkgpm.cc:
- fix packagename extraction when writting apport reports

Michael Vogt 19 years ago
parent
commit
25ffa4e814
2 changed files with 9 additions and 2 deletions
  1. 2 2
      apt-pkg/deb/dpkgpm.cc
  2. 7 0
      debian/changelog

+ 2 - 2
apt-pkg/deb/dpkgpm.cc

@@ -895,9 +895,9 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
 
 
    // get the pkgname and reportfile
    // get the pkgname and reportfile
    pkgname = flNotDir(pkgpath);
    pkgname = flNotDir(pkgpath);
-   pos = pkgname.rfind('_');
+   pos = pkgname.find('_');
    if(pos != string::npos)
    if(pos != string::npos)
-      pkgname = string(pkgname, 0, pos);
+      pkgname = pkgname.substr(0, pos);
 
 
    // find the package versin and source package name
    // find the package versin and source package name
    pkgCache::PkgIterator Pkg = Cache.FindPkg(pkgname);
    pkgCache::PkgIterator Pkg = Cache.FindPkg(pkgname);

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+apt (0.7.6ubuntu3) gutsy; urgency=low
+
+  * apt-pkg/deb/dpkgpm.cc:
+    - fix packagename extraction when writting apport reports
+
+ --
+
 apt (0.7.6ubuntu2) gutsy; urgency=low
 apt (0.7.6ubuntu2) gutsy; urgency=low
 
 
   * doc/examples/sources.list:
   * doc/examples/sources.list: