Skip to content

Commit

Permalink
更新多层if的测试文件
Browse files Browse the repository at this point in the history
  • Loading branch information
thinszx committed Jan 13, 2021
1 parent 3fad0f0 commit e1ecace
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 11 deletions.
5 changes: 4 additions & 1 deletion exec2.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ DWORD WaitForSingleObject(
FILE* fp;
// errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\test.sh", "r");
// errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\iftest.sh", "r");
errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\multiif.sh", "r");
// errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\multiif.sh", "r");
// errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\fail-if.sh", "r");
// errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\lessfi.sh", "r");
errno_t err = fopen_s(&fp, "C:\\Users\\12176\\Desktop\\操作系统课设\\winshell\\plusfi.sh", "r");
if (fp == NULL || err != 0) {
printf_s("Failed to open file!");
return -1;
Expand Down
12 changes: 12 additions & 0 deletions fail-if.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if echo first success
then
echo if success
if what second success???
then
echo multiif success
if echo aaaaaa; then
echo bbb
fi
fi
echo fi success
fi
12 changes: 12 additions & 0 deletions lessfi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if echo first success
then
echo if success
if echo second success
then
echo multiif success
if echo aaaaaa; then
echo bbb
fi

echo fi success
fi
13 changes: 13 additions & 0 deletions plusfi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if echo first success
then
echo if success
if echo second success
then
echo multiif success
if echo aaaaaa; then
echo bbb
fi
fi
echo fi success
fi
fi
3 changes: 3 additions & 0 deletions winshell.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@
<ClInclude Include="winshell2.h" />
</ItemGroup>
<ItemGroup>
<None Include="fail-if.sh" />
<None Include="iftest.sh" />
<None Include="lessfi.sh" />
<None Include="multiif.sh" />
<None Include="plusfi.sh" />
<None Include="test.sh" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
27 changes: 18 additions & 9 deletions winshell.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
<ClCompile Include="没用的api啥的.c">
<Filter>资源文件</Filter>
</ClCompile>
<ClCompile Include="exec1.c">
<Filter>资源文件</Filter>
</ClCompile>
<ClCompile Include="controlflow.c">
<Filter>资源文件</Filter>
</ClCompile>
<ClCompile Include="process.c">
<Filter>资源文件</Filter>
</ClCompile>
<ClCompile Include="controlflow2.c">
<Filter>源文件</Filter>
</ClCompile>
Expand All @@ -39,6 +30,15 @@
<ClCompile Include="process2.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="controlflow.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="exec1.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="process.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h">
Expand All @@ -61,5 +61,14 @@
<None Include="multiif.sh">
<Filter>资源文件</Filter>
</None>
<None Include="lessfi.sh">
<Filter>资源文件</Filter>
</None>
<None Include="fail-if.sh">
<Filter>资源文件</Filter>
</None>
<None Include="plusfi.sh">
<Filter>资源文件</Filter>
</None>
</ItemGroup>
</Project>
5 changes: 4 additions & 1 deletion winshell2.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ void set_ifenv();
/* 定义在process.c中,用作进程执行 */
DWORD process(char* args);
DWORD execute(char** args);
char* concatenate_char_array(char** arr);
char* concatenate_char_array(char** arr);

/* eval.c */
// char* getvar(char** srcp);

0 comments on commit e1ecace

Please sign in to comment.