mirror of
				git://git.code.sf.net/p/zsh/code
				synced 2025-10-31 06:00:54 +01:00 
			
		
		
		
	25643: keep DEBUG and ZERR traps in subshells
This commit is contained in:
		
							parent
							
								
									8bb15c1392
								
							
						
					
					
						commit
						fb67cd46ea
					
				
					 3 changed files with 8 additions and 2 deletions
				
			
		|  | @ -1,5 +1,8 @@ | |||
| 2008-09-11  Peter Stephenson  <pws@csr.com> | ||||
| 
 | ||||
| 	* 25643: Doc/Zsh/builtins.yo, Src/exec.c: keep DEBUG and ZERR | ||||
| 	traps in subshells. | ||||
| 
 | ||||
| 	* 25641: add option (NO_)MULTI_FUNC_DEF to turn off "foo1 | ||||
| 	foo2...()" function definitions. | ||||
| 
 | ||||
|  |  | |||
|  | @ -1330,7 +1330,9 @@ If var(sig) is tt(0) or tt(EXIT) | |||
| and the tt(trap) statement is not executed inside the body of a function, | ||||
| then the command var(arg) is executed when the shell terminates. | ||||
| 
 | ||||
| tt(ZERR), tt(DEBUG), and tt(EXIT) traps are not executed inside other traps. | ||||
| tt(ZERR), tt(DEBUG), and tt(EXIT) traps are not executed inside other | ||||
| traps.  tt(ZERR) and tt(DEBUG) traps are kept within subshells, while | ||||
| other traps are reset. | ||||
| 
 | ||||
| Note that traps defined with the tt(trap) builtin are slightly different | ||||
| from those defined as `tt(TRAP)var(NAL) () { ... }', as the latter have | ||||
|  |  | |||
|  | @ -869,7 +869,8 @@ entersubsh(int flags) | |||
| 
 | ||||
|     if (!(flags & ESUB_KEEPTRAP)) | ||||
| 	for (sig = 0; sig < VSIGCOUNT; sig++) | ||||
| 	    if (!(sigtrapped[sig] & ZSIG_FUNC)) | ||||
| 	    if (!(sigtrapped[sig] & ZSIG_FUNC) && | ||||
| 		sig != SIGDEBUG && sig != SIGZERR) | ||||
| 		unsettrap(sig); | ||||
|     monitor = isset(MONITOR); | ||||
|     if (flags & ESUB_NOMONITOR) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue