BUG 6401 Correct restore logic when handling filename

Match the documentation where the first argument should first be
considered a filename and then a workspace name if the file doesnt
exists.
This commit is contained in:
Alexandre Rosenfeld
2011-06-03 12:21:01 -04:00
parent dea8c861a8
commit 0f0e2ba33f

View File

@@ -395,7 +395,7 @@ function run_workspace_restore($args, $opts) {
$filename = $args[0];
if (strpos($filename, "/") === false && strpos($filename, '\\') === false) {
$filename = PATH_DATA . "backups/$filename";
if (substr_compare($filename, ".tar", -4, 4, true) != 0)
if (!file_exists($filename) && substr_compare($filename, ".tar", -4, 4, true) != 0)
$filename .= ".tar";
}
$info = array_key_exists("info", $opts);