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 1master
parent
4220f083eb
commit
22d0ce56c5
|
@ -34,7 +34,7 @@ BEGINFILE {
|
||||||
print "author: Mike Gerwitz <mtg@gnu.org>"
|
print "author: Mike Gerwitz <mtg@gnu.org>"
|
||||||
|
|
||||||
printf "date: %s\n",
|
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.
|
# Wait until after <main>; everything before it is the HTML header.
|
||||||
|
@ -53,7 +53,7 @@ main && /^<h1 / {
|
||||||
printf "slug: %s\n", \
|
printf "slug: %s\n", \
|
||||||
gensub( /^([0-9]+)-([0-9]+)-[0-9]+-(.*)\.[a-z]+$/,
|
gensub( /^([0-9]+)-([0-9]+)-[0-9]+-(.*)\.[a-z]+$/,
|
||||||
"\\1/\\2/\\3",
|
"\\1/\\2/\\3",
|
||||||
"",
|
1,
|
||||||
name[0] )
|
name[0] )
|
||||||
|
|
||||||
# Skip the date line immediately following the header and grab the first
|
# Skip the date line immediately following the header and grab the first
|
||||||
|
|
Loading…
Reference in New Issue