diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
commit | 9634760d5eae4e8618e4b9ed9752d7305b3695a9 (patch) | |
tree | fc717bec9a623d6e80f2c4544cec14b8b8eb07da /Src/Modules/tcp.c | |
parent | 043c302261dfee52e54e9a6c42b4ebcc2f7ccd33 (diff) | |
download | zsh-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/Modules/tcp.c')
-rw-r--r-- | Src/Modules/tcp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index 5dc00d0bc..96dde66e3 100644 --- a/Src/Modules/tcp.c +++ b/Src/Modules/tcp.c @@ -336,7 +336,7 @@ tcp_connect(Tcp_session sess, char *addrp, struct hostent *zhost, int d_port) } static int -bin_ztcp(char *nam, char **args, char *ops, int func) +bin_ztcp(char *nam, char **args, Options ops, int func) { int herrno, err=1, destport, force=0, verbose=0, test=0, targetfd=0; SOCKLEN_T len; @@ -345,16 +345,16 @@ bin_ztcp(char *nam, char **args, char *ops, int func) struct servent *srv; Tcp_session sess = NULL; - if (ops['f']) + if (OPT_ISSET(ops,'f')) force = 1; - if (ops['v']) + if (OPT_ISSET(ops,'v')) verbose = 1; - if (ops['t']) + if (OPT_ISSET(ops,'t')) test = 1; - if (ops['d']) { + if (OPT_ISSET(ops,'d')) { targetfd = atoi(args[0]); dargs = args + 1; if (!targetfd) { @@ -366,7 +366,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func) dargs = args; - if (ops['c']) { + if (OPT_ISSET(ops,'c')) { if (!dargs[0]) { tcp_cleanup(); } @@ -395,7 +395,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func) } } } - else if (ops['l']) { + else if (OPT_ISSET(ops,'l')) { int lport = 0; if (!dargs[0]) { @@ -462,7 +462,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func) return 0; } - else if (ops['a']) + else if (OPT_ISSET(ops,'a')) { int lfd, rfd; @@ -571,7 +571,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func) remotename = ztpeer->h_name; else remotename = ztrdup(inet_ntoa(sess->peer.in.sin_addr)); - if (ops['L']) { + if (OPT_ISSET(ops,'L')) { int schar; if (sess->flags & ZTCP_ZFTP) schar = 'Z'; |