シェルスクリプト言語xyzshのソースコード。
Revision | d3f5b7ebf6a3598d003f309691400bbf122550a1 (tree) |
---|---|
Time | 2012-10-30 16:22:25 |
Author | ab25cq <ab25cq@gmai...> |
Commiter | ab25cq |
Fixed a bug with expanding exvironmet variable on redirects
@@ -1,4 +1,10 @@ | ||
1 | 1 | |
2 | +2012 30th Octorber version 1.1.7 | |
3 | + | |
4 | + Fixed a bug with expanding environmet on redirects | |
5 | + | |
6 | + Fixed Makefile.in | |
7 | + | |
2 | 8 | 2012 30th Octorber version 1.1.6 |
3 | 9 | |
4 | 10 | Made runnable on cygwin |
@@ -59,7 +59,7 @@ clean: | ||
59 | 59 | distclean: |
60 | 60 | rm -fR xyzsh xyzsh.dSYM src/*.o libxyzsh* config.h Makefile xyzsh.exe* config.log config.status *.stackdump autom4te.cache |
61 | 61 | |
62 | -xyzsh: config.h src/main.c $(LIBXYZSHSO) | |
62 | +xyzsh: config.h src/main.c $(LIBXYZSHSO) $(LIBXYZSHA) | |
63 | 63 | $(CC) -o xyzsh src/main.c $(CFLAGS) -lxyzsh $(LIBS) |
64 | 64 | |
65 | 65 | ######################################################## |
@@ -1312,7 +1312,15 @@ BOOL sCommand_expand_env_redirect(sCommand* command, sObject* nextin, sRunInfo* | ||
1312 | 1312 | int i; |
1313 | 1313 | for(i=0; i<command->mRedirectsNum; i++) { |
1314 | 1314 | char* fname = command->mRedirectsFileNames[i]; |
1315 | - if(fname[0] == PARSER_MAGIC_NUMBER_ENV) { | |
1315 | + BOOL env = FALSE; | |
1316 | + char* p = fname; | |
1317 | + while(*p) { | |
1318 | + if(*p == PARSER_MAGIC_NUMBER_ENV) { | |
1319 | + env = TRUE; | |
1320 | + } | |
1321 | + p++; | |
1322 | + } | |
1323 | + if(env) { | |
1316 | 1324 | char* expanded_str; |
1317 | 1325 | BOOL expand_double_dollar; |
1318 | 1326 | if(!expand_env_to_command(ALLOC &expanded_str, fname, command, runinfo, nextin, &expand_double_dollar)) { |
@@ -112,7 +112,7 @@ static void xyzsh_read_rc() | ||
112 | 112 | |
113 | 113 | void xyzsh_init(enum eAppType app_type, BOOL no_runtime_script) |
114 | 114 | { |
115 | - setenv("XYZSH_VERSION", "1.1.6", 1); | |
115 | + setenv("XYZSH_VERSION", "1.1.7", 1); | |
116 | 116 | setenv("XYZSH_DATAROOTDIR", DATAROOTDIR, 1); |
117 | 117 | |
118 | 118 | stack_init(1);; |
@@ -37,13 +37,15 @@ EOS > ~/.xyzsh/jump | ||
37 | 37 | def menu ( |
38 | 38 | if(! print ~/.xyzsh/menu | -e) ( |
39 | 39 | print <<<EOS |
40 | +vim ~/.xyzsh/menu | |
41 | +vim ~/.xyzsh/macro | |
40 | 42 | ls -al | uc| less |
41 | 43 | pwd | scan . | less |
42 | 44 | ls | each ( if(|chomp | -d) ( | print ) ) |
43 | 45 | EOS > ~/.xyzsh/menu |
44 | 46 | ) |
45 | 47 | |
46 | - cat ~/.xyzsh/menu | selector | chomp | eval | |
48 | + eval $(cat ~/.xyzsh/menu | selector | chomp) | |
47 | 49 | ) |
48 | 50 | |
49 | 51 | def macro ( |