--- an-0.95.orig/an.c +++ an-0.95/an.c @@ -863,7 +863,7 @@ /* If letter is punctuation go to next letter */ - if (letterpos[(int)letter] == -1) + if (letterpos[(unsigned char)letter] == -1) continue; /* Check if letter is available for use (useit==TRUE) */ @@ -1031,7 +1031,7 @@ have_a_letter = FALSE; have_a_digit = FALSE; for (temp_string = line; *temp_string; temp_string++) { - if (letterpos[(int)*temp_string]!=-1) + if (letterpos[(unsigned char)*temp_string]!=-1) have_a_letter = TRUE; if (isdigit (*temp_string)) { have_a_digit = TRUE; @@ -1199,7 +1199,7 @@ for (; *word != '\0'; word++) { /* If letter is punctuation mark skip to next letter */ - int l = letterpos[(int)*word]; + int l = letterpos[(unsigned char)*word]; if (l == -1) continue; @@ -1238,10 +1238,10 @@ while (loop1--) { tmpptr = *words++; for (; *tmpptr != '\0'; tmpptr++) { - if (letterpos[(int)*tmpptr]==-1) + if (letterpos[(unsigned char)*tmpptr]==-1) continue; else - letter_freq[letterpos[(int)*tmpptr]]++; + letter_freq[letterpos[(unsigned char)*tmpptr]]++; } } @@ -1303,8 +1303,8 @@ /* First sort words by frequency of first letter */ - if (letter_freq[letterpos[(int)*tmp_word1]] < - letter_freq[letterpos[(int)*tmp_word2]]) { + if (letter_freq[letterpos[(unsigned char)*tmp_word1]] < + letter_freq[letterpos[(unsigned char)*tmp_word2]]) { #ifdef FORCE_ANSI free (tmp_word1); @@ -1314,8 +1314,8 @@ return (-1); } else { - if (letter_freq[letterpos[(int)*tmp_word1]] > - letter_freq[letterpos[(int)*tmp_word2]]) { + if (letter_freq[letterpos[(unsigned char)*tmp_word1]] > + letter_freq[letterpos[(unsigned char)*tmp_word2]]) { #ifdef FORCE_ANSI free (tmp_word1); @@ -1397,22 +1397,22 @@ /* Check to make sure punctuation appears at the end of words */ - if (letterpos[(int)*let1]==-1) { - if (letterpos[(int)*let2]==-1) + if (letterpos[(unsigned char)*let1]==-1) { + if (letterpos[(unsigned char)*let2]==-1) return 0; else return 1; } - if (letterpos[(int)*let2]==-1) + if (letterpos[(unsigned char)*let2]==-1) return -1; - if (letter_freq[letterpos[(int)*let1]] < - letter_freq[letterpos[(int)*let2]]) + if (letter_freq[letterpos[(unsigned char)*let1]] < + letter_freq[letterpos[(unsigned char)*let2]]) return (-1); - else if (letter_freq[letterpos[(int)*let1]] > - letter_freq[letterpos[(int)*let2]]) + else if (letter_freq[letterpos[(unsigned char)*let1]] > + letter_freq[letterpos[(unsigned char)*let2]]) return (1); if (*let1 < *let2) @@ -1438,13 +1438,13 @@ int c2; do { - if (letterpos[(int)*s1]==-1) { - if (letterpos[(int)*s2]==-1) + if (letterpos[(unsigned char)*s1]==-1) { + if (letterpos[(unsigned char)*s2]==-1) return 0; else return 1; } - if (letterpos[(int)*s2]==-1) + if (letterpos[(unsigned char)*s2]==-1) return 1; while (*(s1 + 1) == *s1) s1++; @@ -1455,8 +1455,8 @@ if (*s2 == '\0') return -1; - c1 = letter_freq[letterpos[(int)*s1]]; - c2 = letter_freq[letterpos[(int)*s2]]; + c1 = letter_freq[letterpos[(unsigned char)*s1]]; + c2 = letter_freq[letterpos[(unsigned char)*s2]]; } while (*s1++ == *s2++); @@ -1587,7 +1587,7 @@ for (tmp_string = string; *tmp_string != '\0'; tmp_string++) { /* If current letter is punctuation mark skip to next letter */ - if (letterpos[(int)*tmp_string]==-1) + if (letterpos[(unsigned char)*tmp_string]==-1) continue; /* Copy letter into NEW_STRING */ @@ -1618,7 +1618,7 @@ for (; *string != '\0'; string++) { /* If letter punctuation mark skip to next letter */ - if (letterpos[(int)*string]==-1) + if (letterpos[(unsigned char)*string]==-1) continue; /* Add 1 to LENGTH */ --- an-0.95.orig/Makefile +++ an-0.95/Makefile @@ -34,7 +34,8 @@ #DEFS=-DFORCE_ANSI -CFLAGS=-O2 -Wall -I $(LIBDIR) $(DEFS) +CFLAGS=-O2 -Wall +CINCLUDES=-I $(LIBDIR) $(DEFS) # Nothing should need changing below here @@ -47,7 +48,7 @@ $(BIN): $(OBJS) - $(CC) $(CFLAGS) -o $(BIN) $(OBJS) + $(CC) $(CFLAGS) $(CINCLUDES) -o $(BIN) $(OBJS) $(OBJS): gan.h $(MAN): @@ -63,7 +64,7 @@ with-getopt: $(OBJS) $(GETOPT) - $(CC) $(CFLAGS) -o $(BIN) $(OBJS) $(GETOPT) + $(CC) $(CFLAGS) $(CINCLUDES) -o $(BIN) $(OBJS) $(GETOPT) install: $(BIN) $(INSTALLDIR)/$(BIN) $(MANDIR)/$(MAN) --- an-0.95.orig/an.6 +++ an-0.95/an.6 @@ -1,5 +1,4 @@ -.\" "%W% %G%" -.TH AN\ 0.93 6 +.TH AN 6 .SH NAME an \- Anagram generator .SH SYNOPSIS @@ -11,7 +10,7 @@ .SH DESCRIPTION .B an finds all anagrams which can be made from the letters in \fBPHRASE\fP, -using words in the specified dictionary (default=/usr/dict/words). +using words in the specified dictionary (default=/usr/share/dict/words). .SH OPTIONS .TP .I \-w, --words @@ -79,10 +78,3 @@ Please report any bugs to richard@deep-thought.org Suggestions and contributions are also welcome. - - - - - - - --- an-0.95.orig/COPYRIGHT +++ an-0.95/COPYRIGHT @@ -1,7 +1,7 @@ an v0.94 - Anagram generator Copyright (C) 1996 Free Software Foundation. Copyright (C) 1995,1996 Richard Jones - Copyright (C) 2001 Paul Martin + Copyright (C) 2001-2004 Paul Martin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- an-0.95.orig/debian/changelog +++ an-0.95/debian/changelog @@ -1,3 +1,21 @@ +an (0.95-3) unstable; urgency=low + + * Bugfixes: + - Fix manpage to refer to /usr/share/dict/words instead of + /usr/dict/words (Closes: #249362) + * Standards-version: 3.6.1 + * Building with debhelper 4 + + -- Paul Martin Wed, 19 May 2004 17:38:41 +0100 + +an (0.95-2) unstable; urgency=low + + * Bugfix: (Closes: #164514) + - Made all casts into letterpos[] be "unsigned char". This is a + related bug to the one fixed in #145848. + + -- Paul Martin Sun, 13 Oct 2002 03:11:36 +0100 + an (0.95-1) unstable; urgency=low * Bugfixes: (Closes: #145848) --- an-0.95.orig/debian/copyright +++ an-0.95/debian/copyright @@ -2,7 +2,8 @@ on Mon, 13 Nov 2000 17:53:04 +0000. The original source can always be found at: - ftp://ftp.debian.org/dists/unstable/main/source/games/ + + http://ftp.debian.org/pool/main/a/an/ The original author of this program, who appears to have disappeared, was Richard Jones . @@ -10,7 +11,7 @@ an v0.93 - Anagram generator Copyright (C) 1996 Free Software Foundation. Copyright (C) 1995,1996 Richard Jones - Portions copyright (C) 2000 Paul Martin + Portions copyright (C) 2000-2004 Paul Martin This program is free software; you can redistribute it and/or modify --- an-0.95.orig/debian/README.Debian +++ an-0.95/debian/README.Debian @@ -4,7 +4,11 @@ The original author has become unreachable, so I've taken over this package in his absence. -The major change so far is that an now looks at /usr/share/dict/words by -default. +The major changes: - -- Paul Martin , Mon, 13 Nov 2000 17:53:04 +0000 +an looks at /usr/share/dict/words by default instead of /usr/dict/words. + +an is capable of working with languages other than English, with +alphabets of up to 64 letters. + + -- Paul Martin , Wed, 19 May 2004 17:17:25 +0100 --- an-0.95.orig/debian/control +++ an-0.95/debian/control @@ -2,14 +2,14 @@ Section: games Priority: optional Maintainer: Paul Martin -Build-Depends: debhelper (>=3) -Standards-Version: 3.5.4 +Build-Depends: debhelper (>=4) +Standards-Version: 3.6.1 Package: an Architecture: any Depends: ${shlibs:Depends} -Recommends: wordlist -Description: Very fast anagram generator. +Recommends: wenglish|wordlist +Description: very fast anagram generator Generates anagrams for a phrase supplied by the user, the words used in the anagram are taken from a specified dictionary which should contain one word per line (default:/usr/share/dict/words). Appears to be up to 10 times --- an-0.95.orig/debian/rules +++ an-0.95/debian/rules @@ -5,11 +5,25 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# This is the debhelper compatability version to use. -export DH_COMPAT=3 - package = an +CFLAGS = -Wall -g +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif + + configure: configure-stamp configure-stamp: dh_testdir @@ -23,8 +37,7 @@ dh_testdir # Add here commands to compile the package. - $(MAKE) - #/usr/bin/docbook-to-man debian/an.sgml > an.1 + $(MAKE) CFLAGS="$(CFLAGS)" touch build-stamp @@ -45,7 +58,8 @@ dh_installdirs # Add here commands to install the package into debian/tmp. - $(MAKE) install DESTDIR=$(CURDIR)/debian/$(package) + $(INSTALL_PROGRAM) $(CURDIR)/an \ + $(CURDIR)/debian/$(package)/usr/games/an # Build architecture-independent files here. @@ -64,7 +78,7 @@ # dh_installpam # dh_installinit # dh_installcron - dh_installman + dh_installman an.6 # dh_installinfo # dh_undocumented dh_installchangelogs --- an-0.95.orig/debian/compat +++ an-0.95/debian/compat @@ -0,0 +1 @@ +4