Import libxo 1.3.1
This commit is contained in:
parent
0922e92a30
commit
5fe9672cf6
@ -12,7 +12,7 @@
|
||||
#
|
||||
|
||||
AC_PREREQ(2.2)
|
||||
AC_INIT([libxo], [1.3.0], [phil@juniper.net])
|
||||
AC_INIT([libxo], [1.3.1], [phil@juniper.net])
|
||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
|
||||
|
||||
# Support silent build rules. Requires at least automake-1.11.
|
||||
|
@ -8104,12 +8104,14 @@ xo_parse_args (int argc, char **argv)
|
||||
cp = strrchr(xo_program, '/');
|
||||
if (cp)
|
||||
xo_program = ++cp;
|
||||
else
|
||||
cp = argv[0]; /* Reset to front of string */
|
||||
|
||||
/* GNU tools add an annoying ".test" as the program extension; remove it */
|
||||
size_t len = strlen(xo_program);
|
||||
static const char gnu_ext[] = ".test";
|
||||
if (len >= sizeof(gnu_ext)) {
|
||||
cp = &cp[len + 1 - sizeof(gnu_ext)];
|
||||
cp += len + 1 - sizeof(gnu_ext);
|
||||
if (xo_streq(cp, gnu_ext))
|
||||
*cp = '\0';
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ main (int argc, char **argv)
|
||||
{ "sold", "number", "Number of items sold" },
|
||||
{ XO_INFO_NULL },
|
||||
};
|
||||
|
||||
char name[] = "test_01.test"; /* test trimming of xo_program */
|
||||
argv[0] = name;
|
||||
|
||||
argc = xo_parse_args(argc, argv);
|
||||
if (argc < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user