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
man -Tlint pkgconf
skipping no-space macro
(mdoc) An input line begins with an Ns macro, or the next argument
after an Ns macro is an isolated closing delimiter. The macro is
ignored.
unusual Xr order
(mdoc) In the SEE ALSO section, an Xr macro with a lower section
number follows one with a higher number, or two Xr macros referring
to the same section are out of alphabetical order.
man: pkgconf.1:114:16: WARNING: skipping no-space macro
man: pkgconf.1:114:39: WARNING: skipping no-space macro
man: pkgconf.1:119:14: WARNING: skipping no-space macro
man: pkgconf.1:119:35: WARNING: skipping no-space macro
man: pkgconf.1:119:56: WARNING: skipping no-space macro
man: pkgconf.1:128:28: WARNING: skipping no-space macro
man: pkgconf.1:147:24: WARNING: skipping no-space macro
man: pkgconf.1:217:2: WARNING: unusual Xr order: pc(5) after pkg.m4(7)
man -Tlint pc
whitespace at end of input line
(mdoc, man, roff) Whitespace at the end of input lines is almost
never semantically significant -- but in the odd case where it
might be, it is extremely confusing when reviewing and maintaining
documents.
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.
missing -width in -tag list, using 8n
(mdoc) Every Bl macro having the -tag argument requires -width, too.
man: pc.5:17:76: STYLE: whitespace at end of input line
man: pc.5:18:50: WARNING: new sentence, new line
man: pc.5:49:67: WARNING: new sentence, new line
man: pc.5:87:38: WARNING: new sentence, new line
man: pc.5:90:27: WARNING: new sentence, new line
man: pc.5:113:66: WARNING: new sentence, new line
man: pc.5:117:61: WARNING: new sentence, new line
man: pc.5:123:49: WARNING: new sentence, new line
man: pc.5:56:2: WARNING: missing -width in -tag list, using 6n: Bl -tag
man: pc.5:80:2: WARNING: missing -width in -tag list, using 6n: Bl -tag
https://man.openbsd.org/mandoc.1