8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 08:03:04 +01:00

Use symbolic name for current dir

This commit is contained in:
Dimitry Sibiryakov 2016-05-06 12:15:15 +02:00
parent 086c479a4c
commit 8967b64c20
5 changed files with 8 additions and 3 deletions

View File

@ -746,7 +746,7 @@ bool ConfigFile::wildCards(const char* currentFileName, const PathName& pathPref
// Any change in directory can cause config change // Any change in directory can cause config change
PathName prefix(pathPrefix); PathName prefix(pathPrefix);
if(!pathPrefix.hasData()) if(!pathPrefix.hasData())
prefix = "."; prefix = PathUtils::curr_dir_link;
bool found = false; bool found = false;
PathName next(components.pop()); PathName next(components.pop());
@ -761,7 +761,7 @@ bool ConfigFile::wildCards(const char* currentFileName, const PathName& pathPref
{ {
PathName name; PathName name;
const PathName fileName = list.getFileName(); const PathName fileName = list.getFileName();
if (fileName == ".") if (fileName == PathUtils::curr_dir_link)
continue; continue;
if (fileName[0] == '.' && next[0] != '.') if (fileName[0] == '.' && next[0] != '.')
continue; continue;

View File

@ -43,7 +43,7 @@ void ParsedPath::parse(const PathName& path)
{ {
continue; continue;
} }
if (elem == ".") // Skip current dir reference if (elem == PathUtils::curr_dir_link) // Skip current dir reference
{ {
continue; continue;
} }

View File

@ -45,6 +45,9 @@ public:
/// The directory separator for the platform. /// The directory separator for the platform.
static const char dir_sep; static const char dir_sep;
/// String used to point to current directory
static const char* curr_dir_link;
/// String used to point to parent directory /// String used to point to parent directory
static const char* up_dir_link; static const char* up_dir_link;

View File

@ -35,6 +35,7 @@
/// The POSIX implementation of the path_utils abstraction. /// The POSIX implementation of the path_utils abstraction.
const char PathUtils::dir_sep = '/'; const char PathUtils::dir_sep = '/';
const char* PathUtils::curr_dir_link = ".";
const char* PathUtils::up_dir_link = ".."; const char* PathUtils::up_dir_link = "..";
const char PathUtils::dir_list_sep = ':'; const char PathUtils::dir_list_sep = ':';

View File

@ -7,6 +7,7 @@
/// The Win32 implementation of the path_utils abstraction. /// The Win32 implementation of the path_utils abstraction.
const char PathUtils::dir_sep = '\\'; const char PathUtils::dir_sep = '\\';
const char* PathUtils::curr_dir_link = ".";
const char* PathUtils::up_dir_link = ".."; const char* PathUtils::up_dir_link = "..";
const char PathUtils::dir_list_sep = ';'; const char PathUtils::dir_list_sep = ';';