This fixes a problem where on Windows the prefix would
not match if the prefix is generated with backslashes
and the rest of the variables use normal slashes
If a key is defined with no value, dequote will allocate a buffer with a
length of 0. Since the buffer's length is 0, any manipulation of its
content is UB.
Example .pc file:
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
xcflags=
xlibs= -lSM -lICE -lX11
Name: Obt
Description: Openbox Toolkit Library
Version: 3.6
Requires: glib-2.0 libxml-2.0
Libs: -L${libdir} -lobt ${xlibs}
Cflags: -I${includedir}/openbox/3.6 ${xcflags}
Output using pkgconf 1.5.2 on x86_64 Linux/musl:
% pkgconf --cflags obt-3.5
-I/usr/include/openbox/3.6 \�\\�I\�\ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2
On Debian/Ubuntu I get:
CC libpkgconf/personality.lo
libpkgconf/personality.c: In function ‘load_personality_with_path’:
libpkgconf/personality.c:195:3: warning: implicit declaration of function ‘strlcpy’ [-Wimplicit-function-declaration]
strlcpy(pathbuf, path, sizeof pathbuf);
^~~~~~~
CC libpkgconf/parser.lo
CCLD libpkgconf.la
ar: `u' modifier ignored since `D' is the default (see `U')
CC cli/pkgconf-main.o
CC cli/pkgconf-getopt_long.o
CC cli/pkgconf-renderer-msvc.o
CCLD pkgconf
./.libs/libpkgconf.so: undefined reference to `strlcpy'
man -Tlint pkg.m4
new sentence, new line
(mdoc) A new sentence starts in the middle of a text line. Start it
on a new input line to help formatters produce correct spacing.
skipping paragraph macro
In mdoc(7) documents, this happens
- at the beginning and end of sections and subsections
- right before non-compact lists and displays
- at the end of items in non-column, non-compact lists
- and for multiple consecutive paragraph macros.
In man(7) documents, it happens
- for empty P, PP, and LP macros
- for IP macros having neither head nor body arguments
- for br or sp right after SH or SS
no blank before trailing delimiter
(mdoc) The last argument of a macro that supports trailing
delimiter arguments is longer than one byte and ends with a
trailing delimiter. Consider inserting a blank such that the
delimiter becomes a separate argument, thus moving it out of
the scope of the macro.
man: pkg.m4.7:30:34: WARNING: new sentence, new line
man: pkg.m4.7:38:20: WARNING: new sentence, new line
man: pkg.m4.7:33:2: WARNING: skipping paragraph macro: Pp after Sh
man: pkg.m4.7:41:2: WARNING: skipping paragraph macro: Pp at the end of Ss
man: pkg.m4.7:46:2: WARNING: skipping paragraph macro: Pp at the end of Ss
man: pkg.m4.7:134:27: STYLE: no blank before trailing delimiter: Nm ... check.
man: pkg.m4.7:143:27: STYLE: no blank before trailing delimiter: Nm ... check.
https://man.openbsd.org/mandoc.1