mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-04-02 04:12:51 +03:00
allow for framebuffer command line parsing to cope with unknown long options
This commit is contained in:
parent
871c14693e
commit
cdd7f2f950
@ -22,6 +22,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
@ -451,6 +452,10 @@ static bool
|
||||
process_cmdline(int argc, char** argv)
|
||||
{
|
||||
int opt;
|
||||
int option_index;
|
||||
static struct option long_options[] = {
|
||||
{0, 0, 0, 0 }
|
||||
}; /* no long options */
|
||||
|
||||
LOG(("argc %d, argv %p", argc, argv));
|
||||
|
||||
@ -473,7 +478,8 @@ process_cmdline(int argc, char** argv)
|
||||
feurl = NETSURF_HOMEPAGE;
|
||||
}
|
||||
|
||||
while((opt = getopt(argc, argv, "f:b:w:h:")) != -1) {
|
||||
while((opt = getopt_long(argc, argv, "f:b:w:h:",
|
||||
long_options, &option_index)) != -1) {
|
||||
switch (opt) {
|
||||
case 'f':
|
||||
fename = optarg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user