diff options
author | Mike Gerwitz <mtg@gnu.org> | 2021-02-24 21:38:40 -0500 |
---|---|---|
committer | Mike Gerwitz <mtg@gnu.org> | 2021-02-24 21:39:53 -0500 |
commit | 22d0ce56c5f73b5913bbe89cede0f8e63e3f5135 (patch) | |
tree | fa2b315365bf0359cc2f66f87e3a0bb501dda1e9 | |
parent | 4220f083ebb5574710a8b8e0863459211349b48b (diff) | |
download | thoughts-22d0ce56c5f73b5913bbe89cede0f8e63e3f5135.tar.gz thoughts-22d0ce56c5f73b5913bbe89cede0f8e63e3f5135.tar.bz2 thoughts-22d0ce56c5f73b5913bbe89cede0f8e63e3f5135.zip |
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
-rwxr-xr-x | src/post2meta | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/post2meta b/src/post2meta index f00a483..cbd9e4c 100755 --- a/src/post2meta +++ b/src/post2meta @@ -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 |