瀏覽代碼

Fixed running programs from other directories in Linux

Arthur Yefimov 3 年之前
父節點
當前提交
98c2f7542f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/term/term_linux.c

+ 1 - 1
src/term/term_linux.c

@@ -54,7 +54,7 @@ int StartProcessIn(char *process, char *dir) {
       }
       }
       close(q[1]);
       close(q[1]);
       close(p[0]);
       close(p[0]);
-      if (dir && dir[0] != '\0') {
+      if (process && process[0] != '/' && dir && dir[0] != '\0') {
         if (getcwd(cmd, 256) == NULL) {
         if (getcwd(cmd, 256) == NULL) {
           perror("StartProcessIn: Could not getcwd()");
           perror("StartProcessIn: Could not getcwd()");
         }
         }