Skip to content

Commit

Permalink
Fix MacVim configure scripts to parse Vim version without 0 patches
Browse files Browse the repository at this point in the history
Vim 9.1 just landed with 0 patches (i.e. 9.1.0) and existing configure
scripts weren't set up to deal with this.
  • Loading branch information
ychin committed Jan 3, 2024
1 parent f112c12 commit 401adfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/auto/configure
Expand Up @@ -10700,9 +10700,12 @@ system ("touch conf.gtktest");
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
g_free(tmp_version);
exit(1);
}

g_free(tmp_version);

if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) &&
Expand Down Expand Up @@ -16560,7 +16563,7 @@ fi

vim_major_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
vim_minor_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([0-9]+),.*/\1/'`
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([0-9]+).*/\1/'`
vim_short_version_string="$vim_major_version_string.$vim_minor_version_string.$snapshot"

if echo "$vim_short_version_string" | /usr/bin/grep -q "^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+$"; then
Expand Down
2 changes: 1 addition & 1 deletion src/configure.ac
Expand Up @@ -4894,7 +4894,7 @@ if test "x$MACOS_X" = "xyes"; then
dnl Set CFBundleShortVersionString of Info.plist
vim_major_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
vim_minor_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([[0-9]]+),.*/\1/'`
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([[0-9]]+).*/\1/'`
vim_short_version_string="$vim_major_version_string.$vim_minor_version_string.$snapshot"

if echo "$vim_short_version_string" | /usr/bin/grep -q "^[[[:digit:]]]\+\.[[[:digit:]]]\+\.[[[:digit:]]]\+$"; then
Expand Down

0 comments on commit 401adfb

Please sign in to comment.