chiark / gitweb /
*** empty log message ***
[sympathy.git] / apps / sympathy.c
index df351f3e9111f56c40082daeeeb5655cfd2e6937..b92dbe473978040f6f541615ff6a567c5ba758ed 100644 (file)
@@ -6,10 +6,20 @@
  *
  */
 
-static char rcsid[] = "$Id$";
+static char rcsid[] =
+  "$Id$";
 
 /*
  * $Log$
+ * Revision 1.13  2008/02/24 00:42:53  james
+ * *** empty log message ***
+ *
+ * Revision 1.12  2008/02/23 11:48:52  james
+ * *** empty log message ***
+ *
+ * Revision 1.11  2008/02/20 20:16:07  james
+ * *** empty log message ***
+ *
  * Revision 1.10  2008/02/20 19:44:37  james
  * @@
  *
@@ -251,7 +261,7 @@ main (int argc, char *argv[])
     "sympathy -c      [-H] -k skt\n"
     "sympathy -r id   [-H]\n" "sympathy {-l|-ls}\n"
 #endif
-    while ((c = getopt (argc, argv, "tscr:lKHd:pb:fL:Fk:n:")) != EOF)
+    while ((c = getopt (argc, argv, "utscr:lKHd:pb:fL:Fk:n:")) != EOF)
     {
       switch (c)
         {
@@ -468,16 +478,13 @@ main (int argc, char *argv[])
 
       if (oflags['H'])
         {
-          fatal_moan ("fix a bug in HTML dispatcher before this works");
+          ansi = ansi_new_html (stdout);
         }
       else
         {
-          ansi = (ANSI *) malloc (sizeof (ANSI));
-          memset (ansi, 0, sizeof (ANSI));
-
           terminal_register_handlers ();
-          ansi->terminal = terminal_open (0, 1);
-          ansi->reset(ansi, NULL);
+          ansi = ansi_new_from_terminal (terminal_open (0, 1),oflags['u'] ? 0:1);
+          ansi->reset (ansi, NULL);
         }
     }
 
@@ -485,7 +492,7 @@ main (int argc, char *argv[])
 
   if (ansi)
     {
-       ansi->close(ansi);
+      ansi->close (ansi);
       terminal_atexit ();
     }
 
@@ -499,6 +506,7 @@ main (int argc, char *argv[])
   if (client_socket)
     socket_free (client_socket);
 
-  printf ("you have now exited sympathy\n");
+  if (!oflags['H'])
+    printf ("you have now exited sympathy\n");
   return 0;
 }