Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=880460002133c3c587aea3f5c2591dd5c8c104d7

commit 880460002133c3c587aea3f5c2591dd5c8c104d7
Author: James Buren <r...@frugalware.org>
Date:   Fri May 29 15:12:25 2009 -0500

pacman.cc
* test if file is accessable

diff --git a/pacman.cc b/pacman.cc
index 316769f..e4509ef 100644
--- a/pacman.cc
+++ b/pacman.cc
@@ -1,4 +1,5 @@
#include <iostream>
+#include <fstream>
#include "pacman.hh"

using namespace PM;
@@ -45,6 +46,11 @@ bool Package::unload(void)

bool Package::load(const std::string &name)
{
-       pacman_pkg_load( (char *) name.c_str(), &pkg );
+       std::ifstream file( name.c_str() );
+       if( file.is_open() )
+       {
+               file.close();
+               pacman_pkg_load( (char *) name.c_str(), &pkg );
+       }
return isvalid();
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to