From 797b75daa6c8bfd2031766989873b370266c0f42 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 27 Feb 2008 09:42:21 +0000 Subject: [PATCH 1/1] *** empty log message *** --- apps/mainloop.h | 5 ++++- apps/sympathy.c | 60 +++++++++++++++++++++---------------------------- version-micro | 2 +- 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/apps/mainloop.h b/apps/mainloop.h index 5d347e7..cea139e 100644 --- a/apps/mainloop.h +++ b/apps/mainloop.h @@ -12,6 +12,9 @@ /* * $Log$ + * Revision 1.4 2008/02/27 09:42:21 james + * *** empty log message *** + * * Revision 1.3 2008/02/27 01:31:14 james * *** empty log message *** * @@ -30,6 +33,6 @@ extern void mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, ANSI * a, - Log * log, int nhistory, int width); + Log * log, int nhistory, CRT_Pos *size); #endif /* __MAINLOOP_H__ */ diff --git a/apps/sympathy.c b/apps/sympathy.c index 3ade5cd..e93c930 100644 --- a/apps/sympathy.c +++ b/apps/sympathy.c @@ -11,12 +11,6 @@ static char rcsid[] = /* * $Log$ - * Revision 1.19 2008/02/27 09:47:05 james - * *** empty log message *** - * - * Revision 1.18 2008/02/27 09:42:53 james - * *** empty log message *** - * * Revision 1.17 2008/02/27 09:42:21 james * *** empty log message *** * @@ -254,7 +248,7 @@ main (int argc, char *argv[]) int c; extern char *optarg; extern int optind, opterr, optopt; - CRT_Pos size = { VT102_COLS_80, VT102_ROWS }; + CRT_Pos size={VT102_COLS_80,VT102_ROWS}; int oflags[128]; char *oargs[128]; @@ -304,6 +298,15 @@ main (int argc, char *argv[]) oflags['s'] = 0; + if (!oflags['s'] && !oflags['c'] && !oflags['t'] && !oflags['r'] + && !oflags['l']) + { + /*If no mode is specified behave like screen */ + oflags['s']++; + oflags['c']++; + } + + { int sum = 0; sum += oflags['t']; @@ -312,23 +315,14 @@ main (int argc, char *argv[]) sum += oflags['l']; sum += oflags['v']; - if (!sum) { - /*If no mode is specified behave like screen */ - oflags['s']++; - oflags['c']++; - } - if (sum != 1) - fatal_moan - ("specifiy exactly one of ( -c and or -s ), -t, -r, -l and -v"); + fatal_moan ("specifiy exactly one of ( -c and or -s ), -t, -r, -l and -v"); } - if (oflags['v']) - { - fprintf (stderr, "Version: %s\n", libsympathy_version ()); - fprintf (stderr, "Version: %s\n", rcsid); - return 0; - } + if (oflags['v']) { + fprintf("Version: %s\n",libsympathy_version()); + return 0; + } if (oflags['l']) return list_sockets (); @@ -434,24 +428,22 @@ main (int argc, char *argv[]) if (oflags['w']) { - char buf[128], *ptr; - strcpy (buf, oargs['w']); - ptr = index (buf, 'x'); - if (ptr) - { - *ptr = 0; - ptr++; - size.y = safe_atoi (ptr); - } - size.x = safe_atoi (buf); + char buf[128],*ptr; + strcpy(buf,oargs['w']); + ptr=index(buf,'x'); + if (ptr) { + *ptr=0; + ptr++; + size.y=safe_atoi(ptr); + } + size.x=safe_atoi(buf); if ((size.x > VT102_MAX_COLS) || (size.x < 1)) fatal_moan ("-w requires a width between 1 and %d\n", VT102_MAX_COLS); if ((size.y > VT102_ROWS) || (size.y < 1)) - fatal_moan ("-w requires a height between 1 and %d\n", - VT102_MAX_COLS); - + fatal_moan ("-w requires a height between 1 and %d\n", VT102_MAX_COLS); + } if (oflags['s'] && !oflags['F']) diff --git a/version-micro b/version-micro index d00491f..00750ed 100644 --- a/version-micro +++ b/version-micro @@ -1 +1 @@ -1 +3 -- 2.30.2