src/post2meta: gensub argument fix

Older versions of Gawk did not mind an empty string as the third
argument, but newer versions complain:

  warning: gensub: third argument `' treated as 1
master
Mike Gerwitz 2021-02-24 21:38:40 -05:00
parent 4220f083eb
commit 22d0ce56c5
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ BEGINFILE {
print "author: Mike Gerwitz <mtg@gnu.org>"
printf "date: %s\n",
gensub( /^(.{10}).*$/, "\\1", "", name[0] )
gensub( /^(.{10}).*$/, "\\1", 1, name[0] )
}
# Wait until after <main>; everything before it is the HTML header.
@ -53,7 +53,7 @@ main && /^<h1 / {
printf "slug: %s\n", \
gensub( /^([0-9]+)-([0-9]+)-[0-9]+-(.*)\.[a-z]+$/,
"\\1/\\2/\\3",
"",
1,
name[0] )
# Skip the date line immediately following the header and grab the first