summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xirssi-version.sh12
-rw-r--r--src/fe-common/core/keyboard.c12
-rw-r--r--src/fe-text/gui-readline.c4
4 files changed, 25 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index 4cebd112..6ca69fc7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,8 @@ default-theme.h: $(srcdir)/default.theme
$(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h
irssi-version.h:
- $(srcdir)/irssi-version.sh $(srcdir) | cmp -s - $@ || $(srcdir)/irssi-version.sh $(srcdir) >$@
+ VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) | \
+ cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) >$@
SUBDIRS = src docs scripts
diff --git a/irssi-version.sh b/irssi-version.sh
index 49abc55e..7588182d 100755
--- a/irssi-version.sh
+++ b/irssi-version.sh
@@ -7,3 +7,15 @@ VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
echo "#define IRSSI_VERSION_TIME $VERSION_TIME"
+
+if echo "${VERSION}" | grep -q -- -head; then
+ # -head version, get extra details from git if we can
+ git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags)
+ if [ $? = 0 ]; then
+ new_version="$(echo "${VERSION}" | sed 's/-head//')"
+ # Because the git tag won't yet include the next release we modify the git
+ # describe output using the version defined from configure.ac.
+ version="${new_version}-$(echo "${git_version}" | sed 's/^.*-[0-9]\+-//')"
+ echo "#define PACKAGE_VERSION \"${version}\""
+ fi
+fi
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c
index 00454401..bec1502e 100644
--- a/src/fe-common/core/keyboard.c
+++ b/src/fe-common/core/keyboard.c
@@ -292,12 +292,18 @@ static int expand_key(const char *key, GSList **out)
}
last_hyphen = !last_hyphen;
} else if (*key == '^') {
+ expand_out_char(*out, '^');
+
/* ctrl-code */
- if (key[1] != '\0')
+ if (key[1] != '\0' && key[1] != '-') {
key++;
+ expand_out_char(*out, *key);
+ }
+ else {
+ /* escaped syntax for ^, see gui-readline.c */
+ expand_out_char(*out, '-');
+ }
- expand_out_char(*out, '^');
- expand_out_char(*out, *key);
expand_out_char(*out, '-');
last_hyphen = FALSE; /* optional */
} else if (last_hyphen && i_isalpha(*key)) {
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index 476a798b..e93f2293 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -393,8 +393,8 @@ static void sig_gui_key_pressed(gpointer keyp)
}
if (strcmp(str, "^") == 0) {
- /* change it as ^^ */
- str[1] = '^';
+ /* change it as ^-, that is an invalid control char */
+ str[1] = '-';
str[2] = '\0';
}