annotate misc/update-manpage-date @ 179:ec3fe72a3e99

Fixed an important bug with folded headers! g_strconcat() returns a *copy* of the string, but hdr->value still pointed to the old header (which probably was a memory leak, too). If the folded part had been quite small it was likely that the new string was at the same position as the old one, thus making everything go well. But if pretty long headers were folded several times it was likely that the new string was allocated somewhere else in memory, thus breaking things. In result mails to lots of recipients (folded header) were frequently only sent to the ones in the first line. Sorry for the inconvenience.
author meillo@marmaro.de
date Fri, 03 Jun 2011 09:52:17 +0200
parents d56914eb9f75
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
157
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
1 #!/bin/sh
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
2 #
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
3 # update the date and version of man pages
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
4
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
5 if [ $# -lt 2 ] ; then
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
6 echo "usage: update-manpage-header VERSION FILES..." >&2
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
7 exit 1
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
8 fi
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
9
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
10
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
11 date=`date +%Y-%m-%d`
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
12
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
13 version="$1"
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
14 shift
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
15
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
16 for i do
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
17 ed -s "$i" <<!
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
18 /^\.TH/s#[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}#$date#
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
19 s#[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}#$version#
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
20 p
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
21 w
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
22 q
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
23 !
d56914eb9f75 added a development helper script to update the date and version in man pages
meillo@marmaro.de
parents:
diff changeset
24 done