cvsuser 03/09/18 00:14:43
Modified: . longopt.c
Log:
23832: longopt cleanup by Steve Clark
Revision Changes Path
1.7 +11 -6 parrot/longopt.c
Index: longopt.c
===================================================================
RCS file: /cvs/public/parrot/longopt.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- longopt.c 21 Jul 2003 18:00:24 -0000 1.6
+++ longopt.c 18 Sep 2003 07:14:43 -0000 1.7
@@ -1,7 +1,7 @@
/* longopt.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: longopt.c,v 1.6 2003/07/21 18:00:24 chromatic Exp $
+ * $Id: longopt.c,v 1.7 2003/09/18 07:14:43 leo Exp $
* Overview:
* Data Structure and Algorithms:
* History:
@@ -96,7 +96,8 @@
* not expecting one, it is just ignored. Bad. */
if (argv[dex][optlen] == '=') {
- if (dptr->opt_flags & (OPTION_required_FLAG |
OPTION_optional_FLAG)) {
+ if (dptr->opt_flags &
+ (OPTION_required_FLAG | OPTION_optional_FLAG)) {
info_buf->opt_arg = &argv[dex][optlen+1];
}
else {
@@ -124,7 +125,8 @@
}
}
else if (dptr->opt_flags & OPTION_optional_FLAG) {
- if (dex+1 < argc && argv[dex+1][0] && argv[dex+1][0] !=
'-') {
+ if (dex+1 < argc && argv[dex+1][0] &&
+ argv[dex+1][0] != '-') {
info_buf->opt_arg = argv[dex+1];
++info_buf->opt_index;
}
@@ -138,7 +140,8 @@
/* Couldn't find it. */
info_buf->opt_id = -1;
- Parrot_snprintf(interp, longopt_error_buffer, 512,
+ Parrot_snprintf(interp, longopt_error_buffer,
+ sizeof(longopt_error_buffer),
"Option %s not known", argv[dex]);
info_buf->opt_error = longopt_error_buffer;
return -1;
@@ -194,7 +197,8 @@
if (*(pos + 1)) {
info_buf->opt_arg = pos + 1;
}
- else if (dex+2 < argc && argv[dex+1][0] && argv[dex+1][0] != '-') {
+ else if (dex+2 < argc && argv[dex+1][0] &&
+ argv[dex+1][0] != '-') {
info_buf->opt_arg = argv[dex+1];
++info_buf->opt_index;
}
@@ -217,7 +221,8 @@
/* Couldn't find it in the table */
info_buf->opt_id = -1;
- Parrot_snprintf(interp, longopt_error_buffer, 512,
+ Parrot_snprintf(interp, longopt_error_buffer,
+ sizeof(longopt_error_buffer),
"Option -%c not known", *pos);
info_buf->opt_error = longopt_error_buffer;
return -1;