From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- drivers/unix/dir_access_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/unix/dir_access_unix.cpp') diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 5f51865432..a1617eb0b4 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3 From 1de1a04b78b65254aa41d7930947df82a121160c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 20:11:33 -0300 Subject: -fix local and global usage for DirAccess, fixes #791 please test anyway.. --- drivers/unix/dir_access_unix.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers/unix/dir_access_unix.cpp') diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index a1617eb0b4..0c0867e030 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -87,7 +87,7 @@ bool DirAccessUnix::dir_exists(String p_dir) { if (p_dir.is_rel_path()) - p_dir=current_dir+"/"+p_dir; + p_dir=get_current_dir().plus_file(p_dir); else p_dir=fix_path(p_dir); @@ -278,9 +278,16 @@ String DirAccessUnix::get_current_dir() { Error DirAccessUnix::rename(String p_path,String p_new_path) { - p_path=fix_path(p_path); - p_new_path=fix_path(p_new_path); - + if (p_path.is_rel_path()) + p_path=get_current_dir().plus_file(p_path); + else + p_path=fix_path(p_path); + + if (p_new_path.is_rel_path()) + p_new_path=get_current_dir().plus_file(p_new_path); + else + p_new_path=fix_path(p_new_path); + return ::rename(p_path.utf8().get_data(),p_new_path.utf8().get_data())==0?OK:FAILED; } Error DirAccessUnix::remove(String p_path) { -- cgit v1.2.3