Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--.hgignore8
-rw-r--r--src/actions/vstudio/vs2005_csproj.lua2
-rw-r--r--src/base/os.lua4
-rw-r--r--src/host/os_match.c18
-rw-r--r--tests/base/test_os.lua39
6 files changed, 43 insertions, 31 deletions
diff --git a/.gitignore b/.gitignore
index 7ded8a3..a5dcc88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ syntax: glob
.DS_Store
+*.bak
*.orig
*~
@@ -11,6 +12,8 @@ obj
release
ipch
src/host/scripts.c
+**.lnt
+**.vlstatus
Makefile
*.make
diff --git a/.hgignore b/.hgignore
index ade2dcb..a5dcc88 100644
--- a/.hgignore
+++ b/.hgignore
@@ -2,12 +2,18 @@ syntax: glob
.DS_Store
+*.bak
+*.orig
+*~
+
build
bin
obj
release
ipch
src/host/scripts.c
+**.lnt
+**.vlstatus
Makefile
*.make
@@ -29,5 +35,3 @@ Scratchpad.txt
Unix Worksheet.worksheet
project.bbprojectdata
Premake4.tmproj
-Visual Lint/PC-lint/**.vlstatus
-*.lnt
diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua
index 0b45c82..6b6238c 100644
--- a/src/actions/vstudio/vs2005_csproj.lua
+++ b/src/actions/vstudio/vs2005_csproj.lua
@@ -38,7 +38,7 @@
local basename = fname:sub(1, -9)
local testname = basename .. ".xaml"
if premake.findfile(prj, testname) then
- return "SubTypeCode", testname
+ return "SubTypeCode", path.getname(testname)
end
else
-- is there a *.Designer.cs file?
diff --git a/src/base/os.lua b/src/base/os.lua
index deff1d0..bc33451 100644
--- a/src/base/os.lua
+++ b/src/base/os.lua
@@ -206,7 +206,9 @@
while (os.matchnext(m)) do
if not os.matchisfile(m) then
local dirname = os.matchname(m)
- matchwalker(path.join(basedir, dirname))
+ if (not dirname:startswith(".")) then
+ matchwalker(path.join(basedir, dirname))
+ end
end
end
os.matchdone(m)
diff --git a/src/host/os_match.c b/src/host/os_match.c
index a267381..5ccc04d 100644
--- a/src/host/os_match.c
+++ b/src/host/os_match.c
@@ -57,9 +57,10 @@ int os_matchisfile(lua_State* L)
int os_matchnext(lua_State* L)
{
MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
- if (m->handle == INVALID_HANDLE_VALUE)
+ if (m->handle == INVALID_HANDLE_VALUE) {
return 0;
-
+ }
+
while (m) /* loop forever */
{
if (!m->is_first)
@@ -69,11 +70,8 @@ int os_matchnext(lua_State* L)
}
m->is_first = 0;
- if (m->entry.cFileName[0] != '.')
- {
- lua_pushboolean(L, 1);
- return 1;
- }
+ lua_pushboolean(L, 1);
+ return 1;
}
return 0;
@@ -155,7 +153,7 @@ int os_matchisfile(lua_State* L)
lua_pushboolean(L, S_ISREG(info.st_mode));
return 1;
}
-
+
return 0;
}
@@ -164,12 +162,12 @@ int os_matchnext(lua_State* L)
MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
if (m->handle == NULL)
return 0;
-
+
m->entry = readdir(m->handle);
while (m->entry != NULL)
{
const char* name = m->entry->d_name;
- if (name[0] != '.' && fnmatch(m->mask, name, 0) == 0)
+ if (fnmatch(m->mask, name, 0) == 0)
{
lua_pushboolean(L, 1);
return 1;
diff --git a/tests/base/test_os.lua b/tests/base/test_os.lua
index fb720c9..db49547 100644
--- a/tests/base/test_os.lua
+++ b/tests/base/test_os.lua
@@ -8,7 +8,7 @@
T.os = { }
local suite = T.os
-
+
--
-- os.findlib() tests
--
@@ -17,17 +17,17 @@
if os.is("windows") then
test.istrue(os.findlib("user32"))
elseif os.is("haiku") then
- test.istrue(os.findlib("root"))
+ test.istrue(os.findlib("root"))
else
- test.istrue(os.findlib("m"))
+ test.istrue(os.findlib("m"))
end
end
-
+
function suite.findlib_FailsOnBadLibName()
test.isfalse(os.findlib("NoSuchLibraryAsThisOneHere"))
end
-
-
+
+
--
-- os.isfile() tests
--
@@ -49,7 +49,7 @@
function suite.matchfiles_OnNonRecursive()
local result = os.matchfiles("*.lua")
test.istrue(table.contains(result, "testfx.lua"))
- test.isfalse(table.contains(result, "folder/ok.lua"))
+ test.isfalse(table.contains(result, "folder/ok.lua"))
end
function suite.matchfiles_Recursive()
@@ -61,31 +61,36 @@
local result = os.matchfiles("**.lua")
test.isfalse(table.contains(result, ".svn/text-base/testfx.lua.svn-base"))
end
-
+
function suite.matchfiles_OnSubfolderMatch()
local result = os.matchfiles("**/xcode/*")
test.istrue(table.contains(result, "actions/xcode/test_xcode_project.lua"))
test.isfalse(table.contains(result, "premake4.lua"))
end
-
+
function suite.matchfiles_OnDotSlashPrefix()
local result = os.matchfiles("./**.lua")
test.istrue(table.contains(result, "folder/ok.lua"))
end
-
+
function suite.matchfiles_OnImplicitEndOfString()
local result = os.matchfiles("folder/*.lua")
test.istrue(table.contains(result, "folder/ok.lua"))
test.isfalse(table.contains(result, "folder/ok.lua.2"))
end
-
+
function suite.matchfiles_OnLeadingDotSlashWithPath()
local result = os.matchfiles("./folder/*.lua")
test.istrue(table.contains(result, "folder/ok.lua"))
end
+ function suite.matchfiles_OnDottedFile()
+ local result = os.matchfiles("../.*")
+ test.istrue(table.contains(result, "../.hgignore"))
+ end
+
+
-
--
-- os.pathsearch() tests
--
@@ -93,20 +98,20 @@
function suite.pathsearch_ReturnsNil_OnNotFound()
test.istrue( os.pathsearch("nosuchfile", "aaa;bbb;ccc") == nil )
end
-
+
function suite.pathsearch_ReturnsPath_OnFound()
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", os.getcwd()))
end
-
+
function suite.pathsearch_FindsFile_OnComplexPath()
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", "aaa;"..os.getcwd()..";bbb"))
end
-
+
function suite.pathsearch_NilPathsAllowed()
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", nil, os.getcwd(), nil))
end
-
+
--
-- os.uuid() tests
--
@@ -123,4 +128,4 @@
test.isequal("-", g:sub(19,19))
test.isequal("-", g:sub(24,24))
end
-
+