diff options
author | marha <marha@users.sourceforge.net> | 2014-11-29 16:13:30 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-11-29 16:13:30 +0100 |
commit | 7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c (patch) | |
tree | e5b941fdff86328a065c46582ba53e0cc73c8576 /xkbcomp/xkbcomp.c | |
parent | 0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6 (diff) | |
parent | a1011d63ffb5cc4f41bf0f4622ee3f1493d419d9 (diff) | |
download | vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.tar.gz vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.tar.bz2 vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/dix/dispatch.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glshim.c
xorg-server/hw/xwin/winclipboard/xevents.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winprefslex.l
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/mi/miarc.c
xorg-server/os/connection.c
Diffstat (limited to 'xkbcomp/xkbcomp.c')
-rw-r--r-- | xkbcomp/xkbcomp.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/xkbcomp/xkbcomp.c b/xkbcomp/xkbcomp.c index 7947ad417..bafef438f 100644 --- a/xkbcomp/xkbcomp.c +++ b/xkbcomp/xkbcomp.c @@ -576,17 +576,37 @@ parseArgs(int argc, char *argv[]) } else if (strncmp(argv[i], "-w", 2) == 0) { - if ((i >= (argc - 1)) || (!isdigit(argv[i + 1][0]))) + unsigned long utmp; + char *tmp2; + /* If text is just after "-w" in the same word, then it must + * be a number and it is the warning level. Otherwise, if the + * next argument is a number, then it is the warning level, + * else the warning level is assumed to be 0. + */ + if (argv[i][2] == '\0') { warningLevel = 0; - if (isdigit(argv[i][2])) - if (sscanf(&argv[i][2], "%i", &itmp) == 1) - warningLevel = itmp; + if (i < argc - 1) + { + utmp = strtoul(argv[i+1], &tmp2, 10); + if (argv[i+1][0] != '\0' && *tmp2 == '\0') + { + warningLevel = utmp > 10 ? 10 : utmp; + i++; + } + } } else { - if (sscanf(argv[++i], "%i", &itmp) == 1) - warningLevel = itmp; + utmp = strtoul(&argv[i][2], &tmp2, 10); + if (*tmp2 == '\0') + warningLevel = utmp > 10 ? 10 : utmp; + else + { + ERROR1("Unknown flag \"%s\" on command line\n", argv[i]); + Usage(argc, argv); + return False; + } } } else if ((strcmp(argv[i], "-xkb") == 0) && (!xkblist)) |