[Pinfo-devel] r185 - pinfo/branches/cxx/src
Nathanael Nerode
neroden-guest at costa.debian.org
Wed Sep 7 01:57:56 UTC 2005
Author: neroden-guest
Date: 2005-09-07 01:57:55 +0000 (Wed, 07 Sep 2005)
New Revision: 185
Modified:
pinfo/branches/cxx/src/filehandling_functions.cxx
Log:
Boolify matchfile.
Modified: pinfo/branches/cxx/src/filehandling_functions.cxx
===================================================================
--- pinfo/branches/cxx/src/filehandling_functions.cxx 2005-09-07 01:55:45 UTC (rev 184)
+++ pinfo/branches/cxx/src/filehandling_functions.cxx 2005-09-07 01:57:55 UTC (rev 185)
@@ -141,10 +141,10 @@
/*
* Looks for name_string -- appended to buf!
- * Returns 1 if it finds a match, 0 if not.
+ * Returns true if it finds a match, false if not.
* Leaves the matching name in buf.
*/
-int
+bool
matchfile(string& buf, const string name_string)
{
string basename_string;
@@ -164,7 +164,7 @@
DIR *dir;
dir = opendir(buf.c_str());
if (dir == NULL) {
- return 0;
+ return false;
}
struct dirent *dp;
@@ -183,11 +183,11 @@
buf += test_filename;
buf += ".info";
closedir(dir);
- return 1;
+ return true;
}
}
closedir(dir);
- return 0;
+ return false;
}
FILE *
@@ -770,8 +770,8 @@
} else {
mybuf = infopaths[i];
/* Modify mybuf in place by suffixing filename -- eeewww */
- int result = matchfile(mybuf, filename);
- if (result == 0) {
+ bool result = matchfile(mybuf, filename);
+ if (!result) {
/* no match found in this directory */
continue;
}
More information about the Pinfo-devel
mailing list