about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-08-27 21:10:30 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-08-27 21:10:30 +0000
commit9634760d5eae4e8618e4b9ed9752d7305b3695a9 (patch)
treefc717bec9a623d6e80f2c4544cec14b8b8eb07da /Src/jobs.c
parent043c302261dfee52e54e9a6c42b4ebcc2f7ccd33 (diff)
downloadzsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.gz
zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.xz
zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.zip
17582: Improved option argument handling.
unposted: Updated version to 4.1.0-dev-6 because of interface change.
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index a2dbea983..eb8d24450 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1252,11 +1252,11 @@ init_hackzero(char **argv, char **envp)
 
 /**/
 int
-bin_fg(char *name, char **argv, char *ops, int func)
+bin_fg(char *name, char **argv, Options ops, int func)
 {
     int job, lng, firstjob = -1, retval = 0, ofunc = func;
 
-    if (ops['Z']) {
+    if (OPT_ISSET(ops,'Z')) {
 	int len;
 
 	if(isset(RESTRICTED)) {
@@ -1277,8 +1277,8 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	return 0;
     }
 
-    lng = (ops['l']) ? 1 : (ops['p']) ? 2 : 0;
-    if (ops['d'])
+    lng = (OPT_ISSET(ops,'l')) ? 1 : (OPT_ISSET(ops,'p')) ? 2 : 0;
+    if (OPT_ISSET(ops,'d'))
 	lng |= 4;
     
     if ((func == BIN_FG || func == BIN_BG) && !jobbing) {
@@ -1327,10 +1327,11 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	    }
 	    for (job = 0; job != maxjob; job++, jobptr++)
 		if (job != ignorejob && jobptr->stat) {
-		    if ((!ops['r'] && !ops['s']) ||
-			(ops['r'] && ops['s']) ||
-			(ops['r'] && !(jobptr->stat & STAT_STOPPED)) ||
-			(ops['s'] && jobptr->stat & STAT_STOPPED))
+		    if ((!OPT_ISSET(ops,'r') && !OPT_ISSET(ops,'s')) ||
+			(OPT_ISSET(ops,'r') && OPT_ISSET(ops,'s')) ||
+			(OPT_ISSET(ops,'r') && 
+			 !(jobptr->stat & STAT_STOPPED)) ||
+			(OPT_ISSET(ops,'s') && jobptr->stat & STAT_STOPPED))
 			printjob(jobptr, lng, 2);
 		}
 	    unqueue_signals();
@@ -1498,7 +1499,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 
 /**/
 int
-bin_kill(char *nam, char **argv, char *ops, int func)
+bin_kill(char *nam, char **argv, Options ops, int func)
 {
     int sig = SIGTERM;
     int returnval = 0;
@@ -1642,10 +1643,10 @@ bin_kill(char *nam, char **argv, char *ops, int func)
 
 /**/
 int
-bin_suspend(char *name, char **argv, char *ops, int func)
+bin_suspend(char *name, char **argv, Options ops, int func)
 {
     /* won't suspend a login shell, unless forced */
-    if (islogin && !ops['f']) {
+    if (islogin && !OPT_ISSET(ops,'f')) {
 	zwarnnam(name, "can't suspend login shell", NULL, 0);
 	return 1;
     }