view help/help_check.sh @ 35833:dbfedb331095

Keep GUI history untouched upon file select "Cancel". Currently, when "Cancel" is selected in the file select menu, the GUI history can be modified nevertheless. Presuming that "Cancel" shall discard changes, the history should be kept unchanged, too. Patch by Hans-Dieter Kosch, hdkosch kabelbw de.
author ib
date Thu, 28 Feb 2013 11:19:59 +0000
parents 4df5cb727be4
children cb9975cda4bc
line wrap: on
line source

#!/bin/sh
# Check help message header files.

CHECK=checkhelp

trap "rm -f ${CHECK}.c ${CHECK}.o" EXIT

CC=$1
shift

for h in "$@"; do
  cat <<EOF > ${CHECK}.c
#include <inttypes.h>
#include <string.h>
#include "config.h"
#include "$h"
void $CHECK () {
EOF
  sed -n "s:^[ \t]*#define[ \t]\+\([0-9A-Za-z_]\+\)[ \t].*:strdup(\1);:p" "$h" >> ${CHECK}.c
  echo "}" >> ${CHECK}.c
  $CC -Werror -c -o ${CHECK}.o ${CHECK}.c || exit
done