myregex_t iscallreg[] = { /* regexes to determine whether this is a reasonable callsign */
{
- "^[A-Z]+[0-9]+[A-Z]+", 0
+ "^[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0
},
{
- "^[0-9]+[A-Z]+[0-9]+[A-Z]+", 0
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?$", 0
+ },
+ {
+ "^[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0
+ },
+ {
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-[1-9]$", 0
+ },
+ {
+ "^[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0
+ },
+ {
+ "^[0-9]+[A-Z]+[0-9]+[A-Z]+[1-9]?-1[0-5]$", 0
},
{
0, 0
f->obuf = mp = cmsg_new(paclen+1, f->sort, f);
}
+ /* ignore trailing spaces */
+ while (l > 0 &&isspace(s[l-1]))
+ --l;
+
for (p = s; p < s+l; ) {
if (mp->inp >= mp->data + paclen) {
flush_text(f);
}
buf[r] = 0;
call = strupper(buf);
- if (!iscallsign(call)) {
- die("Sorry, %s isn't a valid callsign", buf);
- }
+ }
+
+ /* check the callsign */
+ if (!iscallsign(call)) {
+ die("Sorry, %s isn't a valid callsign", call);
}
/* connect up stdin */