From b0c1fb9d9f5486b95a300e608eddcad9673c38c3 Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 28 May 2012 19:24:31 +0000 Subject: [PATCH] Error checking when processing filenames in UNIX. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2509 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/unix/FSNodePOSIX.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index 0d3945a5f..a1f526353 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -156,6 +156,8 @@ POSIXFilesystemNode::POSIXFilesystemNode(const string& p, bool verify) // two chars, so this is safe: _path += p.c_str() + 1; } + else + _path = p; } // Expand './' to the current working directory, // likewise if the path is relative (doesn't start with '/') @@ -180,6 +182,8 @@ POSIXFilesystemNode::POSIXFilesystemNode(const string& p, bool verify) else _path = _path + '/' + p; } + else + _path = p; } else _path = p;