* v2.2 November 1997 -- merge in more changes by Ioannis Tambouras.
* v2.3 November 1997 -- incorporated Colin Plumb's splash-screen idea.
* v2.4 December 1998 -- additions by Brian Ginsbach.
- * v2.5 -- -s option by David N. Welton.
+ * v2.5 December 1998 -- -s option by David N. Welton.
+ * v2.6 June 1999 -- bug fixes by M.R. van Schouwen.
*
* Tries to interpret arguments as names or aliases of ascii characters
* and dumps out *all* the aliases of each. Accepts literal characters,
*
* The slang names used are selected from the 2.2 version of the USENET ascii
* pronunciation guide. Some additional ones were merged in from the Jargon
- * File. Matej Vela added ISO names.
+ * File.
*
* Reproduce, use, and modify this as you like, as long as you don't
* remove the authorship notice and clearly mark your changes. Send me
(void) sscanf(str + 2, "%x", &hval);
else if (tolower(str[0]) == 'x')
(void) sscanf(str + 1, "%x", &hval);
- else if (tolower(str[len - 1]) == 'h')
+ else if ((len >= 2) && (len <= 3) &&
+ (strspn(str,"0123456789ABCDEFabcdef") == (len-1)) &&
+ (tolower(str[len - 1]) == 'h'))
(void) sscanf(str, "%x", &hval);
/* accept 0onn, \onnn, onnn and \nnn forms for octal */
speak(oval & 0xff);
if (bval > -1 && bval < 256)
speak(bval & 0xff);
- if (hval > -1 || dval > -1 || oval > -1 || bval > -1)
- return;
- if (hval < 256 || dval < 256 || oval < 256 || bval < 256)
- return;
+ if (!(hval==-1 && dval==-1 && oval==-1 && bval==-1))
+ {
+ if (hval > -1 || dval > -1 || oval > -1 || bval > -1)
+ return;
+ if (hval < 256 || dval < 256 || oval < 256 || bval < 256)
+ return;
+ }
}
if (sscanf(str, "%d/%d", &hi, &lo) == 2) /* code table reference? */
for (ch = 0; ch < 128; ch++)
for (ptr = &cnames[ch][1]; *ptr; ptr++)
if (!stricmp(*ptr, canbuf))
- { speak(ch); return; }
+ speak(ch);
} /* outer if */
}
/******************************************************************/