aboutsummaryrefslogtreecommitdiffhomepage
path: root/path.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-19 22:55:15 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-19 22:55:15 +0530
commit74a7303c2339eee146fd436849c61fe1bf506e30 (patch)
tree321894506b06fddbabfabfb397e535d64ca30e31 /path.cpp
parentd8a99917386146f47fc178c80b1d07f9e94aa121 (diff)
Modified functions in function.h/.cpp to use wcstring instead wchar_t*, other files also modified to use wcstring.
Diffstat (limited to 'path.cpp')
-rw-r--r--path.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/path.cpp b/path.cpp
index d56b917d..50b35795 100644
--- a/path.cpp
+++ b/path.cpp
@@ -405,12 +405,12 @@ wchar_t *path_allocate_cdpath( const wchar_t *dir, const wchar_t *wd )
for (wcstring_list_t::const_iterator iter = paths.begin(); iter != paths.end(); iter++) {
struct stat buf;
- const wchar_t *dir = iter->c_str();
+ const wcstring &dir = *iter;
if( wstat( dir, &buf ) == 0 )
{
if( S_ISDIR(buf.st_mode) )
{
- res = wcsdup(dir);
+ res = wcsdup(dir.c_str());
break;
}
else
@@ -534,7 +534,7 @@ bool paths_are_same_file(const wcstring &path1, const wcstring &path2) {
return true;
struct stat s1, s2;
- if (wstat(path1.c_str(), &s1) == 0 && wstat(path2.c_str(), &s2) == 0) {
+ if (wstat(path1, &s1) == 0 && wstat(path2, &s2) == 0) {
return s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
} else {
return false;