Index: Makefile =================================================================== RCS file: /usr/cvsroot/gastman/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- Makefile 19 Mar 2004 20:03:34 -0000 1.5 +++ Makefile 29 Mar 2004 23:33:29 -0000 @@ -8,7 +8,7 @@ # For GTK 1.2 # GTKFLAGS=$(shell \ - if [ -z $(GTK2FLAGS) ]; then \ + if [ -z "$(GTK2FLAGS)" ]; then \ if [ `which gtk12-config 2>/dev/null`="" ]; then \ echo `gtk-config --cflags`; \ else \ Index: gastman.c =================================================================== RCS file: /usr/cvsroot/gastman/gastman.c,v retrieving revision 1.11 diff -u -r1.11 gastman.c --- gastman.c 25 Mar 2004 00:49:14 -0000 1.11 +++ gastman.c 29 Mar 2004 23:33:31 -0000 @@ -202,13 +202,20 @@ *s = '\0'; if (!strcmp(pat, copy)) return 1; - } else if (!strncasecmp(tech, "Local", 3)) { + } else if (!strncasecmp(tech, "Local", 5)) { /* Local Channel, match before - */ s = strchr(copy, '-'); if (s) *s = '\0'; if (!strcmp(pat, copy)) return 1; + } else if (!strncasecmp(tech, "H323", 4)) { + /* H323 Channel, match before : */ + s = strchr(copy, ':'); + if (s) + *s = '\0'; + if (!strncmp(pat, copy, strlen(pat))) + return 1; } else { fprintf(stderr, "Dunno how to tell if %s is %s\n", real, pat); } @@ -299,7 +306,7 @@ } cur = cur->next; } - if (rand() % 2) + if (rand() & 1024) return "manonphone"; else return "womanonphone"; @@ -1250,9 +1257,30 @@ } } +static char *term_strip(char *dest, char *src, int buflen) { + int destoffset=0,srcoffset=0; + while (destoffset < buflen) { + switch (src[srcoffset]) { + case '\x1b': + while ((src[srcoffset] != 'm') && (src[srcoffset] != '\0')) + srcoffset++; + if (src[srcoffset] == 'm') + srcoffset++; + break; + default: + dest[destoffset++] = src[srcoffset++]; + } + if (src[srcoffset] == '\0') { + dest[destoffset] = '\0'; + break; + } + } + return dest; +} + static char *__gastman_run_command(const char *cmd) { - static char buf[4096]; + static char buf[8192], buf2[8192]; int yah = 0; int x; struct message *m; @@ -1271,7 +1299,8 @@ strncat(buf, m->headers[x], sizeof(buf) - strlen(buf)); } } - return buf; + term_strip(buf2, buf, sizeof(buf2)); + return buf2; } return NULL; } @@ -1784,7 +1813,7 @@ strncpy(host, *argv, sizeof(host) - 1); if (strlen(host) || - (!gui_get_hostname(host, sizeof(host) -1) && + (!gui_get_hostname(host, sizeof(host) - 1) && strlen(host))) { if (!login(host)) { manage_calls(host);