view mcabber/hgcset.sh @ 2358:b010ffcae282

Don't crash on presence from bare room JID While handling MUC presence, check whether it was sent from the bare room JID before assuming a non-NULL resource name. These days, some servers send presence from the bare room JID to handle MUC avatars.
author Holger Weiß <holger@zedat.fu-berlin.de>
date Tue, 22 Oct 2019 19:59:21 +0200
parents e8f2db654e67
children
line wrap: on
line source

#! /bin/sh

srcdir="$1"
builddir="$2"

if [ ! -f "$srcdir/logprint.h" ]; then
  echo "Unable to find mcabber sources!" >&2
  exit 1
fi

cd "$srcdir"

if which hg > /dev/null 2>&1; then
  cs=$(hg id 2> /dev/null | cut -d' ' -f1)
  if test $? -eq 0; then
    if [ x"$cs" != x ]; then
      grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \
        echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h"
      exit 0
    fi
  fi
fi

echo > "$builddir/hgcset.h"