1#!/bin/sh -
2#
3# $Id: chk.str,v 12.2 2008/05/07 12:45:00 bschmeck Exp $
4#
5# Check spelling in quoted strings.
6
7d=../..
8
9[ -f $d/LICENSE ] || {
10	echo 'FAIL: cannot find source distribution directory.'
11	exit 1
12}
13
14t1=__t1
15
16sed -e '/^#include/d' \
17    -e '/"/!d' \
18    -e 's/^[^"]*//' \
19    -e 's/%s/ /g' \
20    -e 's/[^"]*$//' \
21    -e 's/\\[nt]/ /g' \
22    `find $d -name '*.[ch]' -o -name '*.cpp' -o -name '*.java' |
23    sed -e '/\/perl\//d' -e '/\/test_erlang\//d'` |
24spell | sort -u | comm -23 /dev/stdin spell.ok > $t1
25
26test -s $t1 && {
27	cat $t1
28	echo "FAIL: found questionable spelling in strings."
29	exit 1
30}
31
32egrep -h '/\* | \* ' \
33    `find $d -name '*.[ch]' -o -name '*.cpp' | sed -e '/\/perl\//d' -e '/\/test_erlang\//d'` |
34spell | sort -u | comm -23 /dev/stdin spell.ok | tee /tmp/f/1 > $t1
35
36test -s $t1 && {
37	cat $t1
38	echo "FAIL: found questionable spelling in comments."
39	exit 1
40}
41
42exit 0
43