/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
+
if ((mntf = setmntent ("/etc/mtab", "r")) == 0) {
return "";
}
n = 0;
matchlen = 0;
- /* note: strcmp's semantics are not
+ /* note: strcmp's semantics are not
strict enough to use for this.
*/
}
#elif defined(PLATFORM_WINDOWS)
-
+#include <assert.h>
string
mountpoint (string path)
{
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
- /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
+
+ /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
application."
-
+
Thus: we do NOT try to free memory allocated by getmntinfo()
*/
unsigned int n = 0;
matchlen = 0;
- /* note: strcmp's semantics are not
+ /* note: strcmp's semantics are not
strict enough to use for this.
*/
}
}
}
-
+
return best;
}
#endif // HAVE_GETMNTENT
#ifdef TEST_MOUNTPOINT
-
+
main (int argc, char *argv[])
{
printf ("mp of %s = %s\n", argv[1], mountpoint (argv[1]).c_str());