view mcabber/hgcset.sh @ 980:023891f99732

Fixes truncating utf-8 buddy names (Myhailo Danylenko) This patch fixes the problem with utf-8 buddy names, which include multibyte characters. Without patch names will be decreased by as many extra bytes as we have in name. Note by Mikael: When a non-UTF-8 locale is used, the conversion from UTF-8 could fail, which gave a "(null)" buddy name.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 21 Oct 2006 15:00:41 +0200
parents e6d42f239541
children 6cb8edbda6d2
line wrap: on
line source

#! /bin/sh

if [ ! -f logprint.h ]; then
  echo "You are not in the src directory" >&2
  exit 1
fi

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

echo > hgcset.h