aboutsummaryrefslogtreecommitdiffhomepage
path: root/history.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-18 22:41:22 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-18 22:41:22 +0530
commitc9f4e91df88112ea4ff5f5d9a993c3655672ce93 (patch)
tree2614e98acaea7c8e912208850e9f814aa92cb49a /history.cpp
parentc0ed169fdcd153cc54e4aa392775aa4233786ed1 (diff)
Modified most functions in wutil.h/.cpp to use wcstring instead of wchar_t*, removing calls to c_str() while calling these functions in other files.
Diffstat (limited to 'history.cpp')
-rw-r--r--history.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/history.cpp b/history.cpp
index ad9abca2..b31d7694 100644
--- a/history.cpp
+++ b/history.cpp
@@ -409,7 +409,7 @@ void history_t::load_old_if_needed(void)
if( ! filename.empty() )
{
- if( ( fd = wopen( filename.c_str(), O_RDONLY ) ) > 0 )
+ if( ( fd = wopen( filename, O_RDONLY ) ) > 0 )
{
off_t len = lseek( fd, 0, SEEK_END );
if( len != (off_t)-1)
@@ -595,7 +595,7 @@ void history_t::save_internal()
if( ! tmp_name.empty() )
{
FILE *out;
- if( (out=wfopen( tmp_name.c_str(), "w" ) ) )
+ if( (out=wfopen( tmp_name, "w" ) ) )
{
/* Load old */
@@ -639,7 +639,7 @@ void history_t::save_internal()
else
{
wcstring new_name = history_filename(name, wcstring());
- wrename(tmp_name.c_str(), new_name.c_str());
+ wrename(tmp_name, new_name);
}
}
}
@@ -664,7 +664,7 @@ void history_t::clear(void) {
old_item_offsets.clear();
wcstring filename = history_filename(name, L"");
if (! filename.empty())
- wunlink(filename.c_str());
+ wunlink(filename);
this->clear_file_state();
}
@@ -710,7 +710,7 @@ int file_detection_context_t::perform_file_detection(bool test_all) {
if (path.at(0) != '/') {
path.insert(0, working_directory);
}
- path_is_valid = (0 == waccess(path.c_str(), F_OK));
+ path_is_valid = (0 == waccess(path, F_OK));
}