• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

シェルスクリプト言語xyzshのソースコード。


Commit MetaInfo

修订版148a5fba9e977e191e6b2bc26e80f4354bfe8855 (tree)
时间2012-11-05 11:52:23
作者ab25cq <ab25cq@gmai...>
Commiterab25cq

Log Message

1.1.8a

更改概述

差异

--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,8 @@
11
2+2012 5th Norvember version 1.1.8a
3+
4+ Fixed errror message.
5+
26 2012 30th Octorber version 1.1.8
37
48 Added -index option to "add" inner command and "del" inner command.
--- a/src/block.c
+++ b/src/block.c
@@ -1130,7 +1130,7 @@ static BOOL expand_env_to_command(ALLOC char** result, char* str, sCommand* comm
11301130
11311131 if(!run(env->mBlock, nextin, nextout, &rcode, runinfo->mCurrentObject, runinfo->mRunningObject))
11321132 {
1133- err_msg("run time error", runinfo->mSName, runinfo->mSLine, command->mArgs[0]);
1133+ err_msg_adding("run time error", runinfo->mSName, runinfo->mSLine, command->mArgs[0]);
11341134 runinfo->mRCode = rcode;
11351135 FREE(buf.mBuf);
11361136 return FALSE;
--- a/src/run.c
+++ b/src/run.c
@@ -561,6 +561,22 @@ static BOOL wait_child_program(pid_t pid, pid_t nextin_reader_pid, int nextout2,
561561 /// exited normally ///
562562 else if(WIFEXITED(status)) {
563563 runinfo->mRCode = WEXITSTATUS(status);
564+
565+ /// command not found ///
566+ if(runinfo->mRCode == 127) {
567+ if(gAppType == kATConsoleApp) // && nextout2 == 1)
568+ {
569+ if(tcsetpgrp(0, getpgid(0)) < 0) {
570+ perror("tcsetpgrp(xyzsh)");
571+ exit(1);
572+ }
573+ }
574+
575+ char buf[BUFSIZ];
576+ snprintf(buf, BUFSIZ, "command not found");
577+ err_msg(buf, runinfo->mSName, runinfo->mSLine, program);
578+ return FALSE;
579+ }
564580 }
565581 /// stopped from signal ///
566582 else if(WIFSTOPPED(status)) {
@@ -644,15 +660,13 @@ static BOOL run_exec_cprog(sCommand* command, char* program, int nextin, int nex
644660 if(program_at_cd) {
645661 if(access(program, X_OK) == 0) {
646662 fprintf(stderr, "This is program at current directory\n");
647- kill(getppid(), SIGUSR1);
648- exit(1);
663+ exit(127);
649664 }
650665 }
651666
652667 execv(program, command->mArgsRuntime);
653668 //fprintf(stderr, "exec('%s') error\n", command->mArgsRuntime[0]); // comment out for try
654- kill(getppid(), SIGUSR1);
655- exit(1);
669+ exit(127);
656670 }
657671
658672 static BOOL run_external_command(char* program, sObject* nextin, sObject* nextout, sRunInfo* runinfo)
--- a/src/xyzsh.c
+++ b/src/xyzsh.c
@@ -112,7 +112,7 @@ static void xyzsh_read_rc()
112112
113113 void xyzsh_init(enum eAppType app_type, BOOL no_runtime_script)
114114 {
115- setenv("XYZSH_VERSION", "1.1.8", 1);
115+ setenv("XYZSH_VERSION", "1.1.8a", 1);
116116 setenv("XYZSH_DATAROOTDIR", DATAROOTDIR, 1);
117117
118118 stack_init(1);;