From 6acc6fff864d35feb94db4a1a4cbfedf54d834d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Wed, 29 Jul 2009 13:08:54 +0200 Subject: [PATCH] Fix warning. --- src/install.cc | 2 +- src/repos.cc | 3 ++- src/repos.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/install.cc b/src/install.cc index c6978a4..a9b3240 100755 --- a/src/install.cc +++ b/src/install.cc @@ -563,7 +563,7 @@ void install_remove(Zypper & zypper, !(str.find("perl(") == 0)) // bnc #433679 { repo = str.substr(0, pos); - if (match_repo(zypper, repo, &RepoInfo())) + if (match_repo(zypper, repo)) { str = str.substr(pos + 1); force_by_name = true; //! \todo until there is a solver API for this diff --git a/src/repos.cc b/src/repos.cc index 3faa9f8..dbcc4c1 100644 --- a/src/repos.cc +++ b/src/repos.cc @@ -324,7 +324,8 @@ bool match_repo(Zypper & zypper, string str, RepoInfo *repo) } if (found) { - *repo = *known_it; + if (repo) + *repo = *known_it; break; } } diff --git a/src/repos.h b/src/repos.h index 30c1fcf..87afd21 100644 --- a/src/repos.h +++ b/src/repos.h @@ -74,7 +74,7 @@ void clean_repos(Zypper & zypper); * \param repo pointer to fill with found repository * \return success if respository is found */ -bool match_repo(Zypper & zypper, const std::string str, zypp::RepoInfo *repo); +bool match_repo(Zypper & zypper, const std::string str, zypp::RepoInfo *repo = 0); /** -- 2.7.4