Selaa lähdekoodia

fix: 修复run模式参数检测的bug

SongZihuan 3 vuotta sitten
vanhempi
sitoutus
16dc5af7d3
2 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 3 2
      CMakeLists.txt
  2. 1 1
      src/main.c

+ 3 - 2
CMakeLists.txt

@@ -58,7 +58,6 @@ file(TO_NATIVE_PATH ${INSTALL_LOG} _INSTALL_LOG_NATIVE)
 string(REPLACE "\\" "\\\\" INSTALL_LOG_NATIVE ${_INSTALL_LOG_NATIVE})  # 转义
 unset(_INSTALL_LOG_NATIVE)
 
-include(info)
 include(filename)
 
 # CMake对象属性的初始化值的相关设定
@@ -159,4 +158,6 @@ set(_build_test ${BUILD_TEST})
 if (_build_test)
     enable_testing()
 endif()
-add_subdirectory(test)  # test的相关内容仍会被构建
+add_subdirectory(test)  # test的相关内容仍会被构建
+
+include(info)

+ 1 - 1
src/main.c

@@ -159,7 +159,7 @@ static int mainRun(ff_FFlags *ff) {
     int exit_code = 0;
     char **argv = NULL;
     int argc = ff_get_process_argv(&argv, ff);
-    if (argv == 0) {
+    if (argc == 0) {
         writeErrorLog(aFunlangLogger, log_default, "There are not file to run.");
         return 1;
     }