forked from github/server
Merge pull request #654 from ennorehling/master
bug 2282: at_keys can have 0 keys
This commit is contained in:
commit
2a71a3fc8f
11
s/build
11
s/build
|
@ -1,8 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
ROOT=`pwd`
|
ROOT=$(git rev-parse --show-toplevel)
|
||||||
while [ ! -d $ROOT/.git ]; do
|
|
||||||
ROOT=`dirname $ROOT`
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -z "$BUILD" ] && BUILD=Debug
|
[ -z "$BUILD" ] && BUILD=Debug
|
||||||
if [ -z "$JOBS" ] ; then
|
if [ -z "$JOBS" ] ; then
|
||||||
|
@ -37,7 +34,13 @@ git submodule update
|
||||||
|
|
||||||
echo "build eressea"
|
echo "build eressea"
|
||||||
cd $ROOT/$BUILD
|
cd $ROOT/$BUILD
|
||||||
|
BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//')
|
||||||
|
if [ "$BRANCH" == "master" ] ; then
|
||||||
VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//')
|
VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//')
|
||||||
cmake -DERESSEA_VERSION="$VERSION" ..
|
cmake -DERESSEA_VERSION="$VERSION" ..
|
||||||
|
else
|
||||||
|
REV=$(git rev-parse --short HEAD)
|
||||||
|
cmake -DERESSEA_BUILDNO="$REV-$BUILD" ..
|
||||||
|
fi
|
||||||
make $MAKEOPTS && make test
|
make $MAKEOPTS && make test
|
||||||
cd $OLDPWD
|
cd $OLDPWD
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
ROOT=$(pwd)
|
|
||||||
while [ ! -d $ROOT/.git ]; do
|
|
||||||
ROOT=$(dirname $ROOT)
|
|
||||||
if [ "$ROOT" == "/" ; then
|
|
||||||
echo "could not find root, are you in the git repository?"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
ROOT=$(git rev-parse --show-toplevel)
|
||||||
[ -z $BUILD ] && BUILD=Debug
|
[ -z $BUILD ] && BUILD=Debug
|
||||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
||||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||||
|
|
|
@ -10,12 +10,11 @@ done
|
||||||
|
|
||||||
DEST=$(dirname $ROOT)/server
|
DEST=$(dirname $ROOT)/server
|
||||||
|
|
||||||
MACHINE=`uname -m`
|
|
||||||
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
|
||||||
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
||||||
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
||||||
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
||||||
BIN_DIR="build-$MACHINE-$CC-Debug"
|
BIN_DIR="Debug"
|
||||||
|
|
||||||
cd $ROOT/$BIN_DIR
|
cd $ROOT/$BIN_DIR
|
||||||
make install
|
make install
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ROOT=$(pwd)
|
ROOT=$(git rev-parse --show-toplevel)
|
||||||
while [ ! -d $ROOT/.git ]; do
|
|
||||||
ROOT=$(dirname $ROOT)
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -z $BUILD ] && BUILD=Debug ; export BUILD
|
[ -z $BUILD ] && BUILD=Debug ; export BUILD
|
||||||
|
|
||||||
if [ ! -e $ROOT/$BUILD ]; then
|
if [ ! -e $ROOT/$BUILD ]; then
|
||||||
|
|
|
@ -38,7 +38,10 @@ static void a_writekeys(const attrib *a, const void *o, storage *store) {
|
||||||
static int a_readkeys(attrib * a, void *owner, gamedata *data) {
|
static int a_readkeys(attrib * a, void *owner, gamedata *data) {
|
||||||
int i, *p = 0;
|
int i, *p = 0;
|
||||||
READ_INT(data->store, &i);
|
READ_INT(data->store, &i);
|
||||||
assert(i < 4096 && i>0);
|
assert(i < 4096 && i>=0);
|
||||||
|
if (i == 0) {
|
||||||
|
return AT_READ_FAIL;
|
||||||
|
}
|
||||||
a->data.v = p = malloc(sizeof(int)*(i + 1));
|
a->data.v = p = malloc(sizeof(int)*(i + 1));
|
||||||
*p++ = i;
|
*p++ = i;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#ifndef ERESSEA_VERSION
|
#ifndef ERESSEA_VERSION
|
||||||
// the version number, if it was not passed to make with -D
|
// the version number, if it was not passed to make with -D
|
||||||
#define ERESSEA_VERSION "3.10.0-devel"
|
#define ERESSEA_VERSION "3.10.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *eressea_version(void) {
|
const char *eressea_version(void) {
|
||||||
|
|
Loading…
Reference in New Issue