mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-26 16:31:11 +00:00
support both foo.sheepvm and foo.sheepvm/ command-line parameters
This commit is contained in:
parent
5a8dfa1b36
commit
a98f16a1bd
@ -365,7 +365,9 @@ static bool valid_vmdir(const char *path)
|
||||
{
|
||||
const int suffix_len = sizeof(".sheepvm") - 1;
|
||||
int len = strlen(path);
|
||||
if (len > suffix_len && !strcmp(path + len - suffix_len, ".sheepvm")) {
|
||||
if (len && path[len - 1] == '/') // to support both ".sheepvm" and ".sheepvm/"
|
||||
len--;
|
||||
if (len > suffix_len && !strncmp(path + len - suffix_len, ".sheepvm", suffix_len)) {
|
||||
struct stat d;
|
||||
if (!stat(path, &d) && S_ISDIR(d.st_mode)) {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user