[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master 34ad093: * src/mlgetopt.c (getopt): Permit merg
From: |
Alexei Podtelezhnikov |
Subject: |
[freetype2-demos] master 34ad093: * src/mlgetopt.c (getopt): Permit merged option-argument pairs. |
Date: |
Mon, 10 Jun 2019 22:07:06 -0400 (EDT) |
branch: master
commit 34ad093512e951ddf82351dba8392dc0ea14bf09
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>
* src/mlgetopt.c (getopt): Permit merged option-argument pairs.
---
ChangeLog | 4 ++++
src/mlgetopt.c | 13 +++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6923da1..f186e55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-06-10 Alexei Podtelezhnikov <address@hidden>
+
+ * src/mlgetopt.c (getopt): Permit merged option-argument pairs.
+
2019-06-09 Alexei Podtelezhnikov <address@hidden>
* src/ft{view,grid,string}.c (parse_cmdline): Generalize batch mode...
diff --git a/src/mlgetopt.c b/src/mlgetopt.c
index 607130a..7d14497 100644
--- a/src/mlgetopt.c
+++ b/src/mlgetopt.c
@@ -8,7 +8,7 @@
* address@hidden (Mark Leisher)
* 10 October 1997
*
- * Last update 2009-03-11.
+ * Last update 2019-06-10.
*/
#include "mlgetopt.h"
@@ -140,21 +140,18 @@
/*
* If the option expects an argument, get it.
*/
- if ( *(pp + 1) == ':' && (optarg = av[optind]) == 0 )
+ if ( *(pp + 1) == ':' &&
+ *(optarg = p + 2) == 0 &&
+ (optarg = av[optind++]) == 0 )
{
/*
- * If the option argument is NULL, issue a warning and return a '?'.
+ * If the option argument is missing, issue a warning and return a '?'.
*/
if ( opterr )
fprintf( stderr, "%s: option requires an argument -- %c\n",
cmdname, opt );
opt = '?';
}
- else if ( optarg )
- /*
- * Increment the option index past the argument.
- */
- optind++;
/*
* Return the option character.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master 34ad093: * src/mlgetopt.c (getopt): Permit merged option-argument pairs.,
Alexei Podtelezhnikov <=