[970] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r958 - in branches/barnowl_unicode: . owl

daemon@ATHENA.MIT.EDU (asedeno@MIT.EDU)
Thu Oct 29 18:11:42 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@nelhage.com
To: dirty-owl-hackers@mit.edu
From: asedeno@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Tue, 19 Feb 2008 18:13:26 -0500 (EST)

Author: asedeno
Date: 2008-02-19 18:13:25 -0500 (Tue, 19 Feb 2008)
New Revision: 958

Modified:
   branches/barnowl_unicode/
   branches/barnowl_unicode/owl/message.c
   branches/barnowl_unicode/owl/owl.c
Log:
Merged revisions 955-957 via svnmerge from 
file:///afs/sipb.mit.edu/project/barnowl/src/svn/trunk

........
  r956 | geofft | 2008-02-19 04:55:35 -0500 (Tue, 19 Feb 2008) | 4 lines
  
  Fix a bug where an explicit (local) realm foiled
  owl_message_get_cc_without_recipient(). (per quentin)
........
  r957 | asedeno | 2008-02-19 18:10:18 -0500 (Tue, 19 Feb 2008) | 4 lines
  
  owl.c:
  * Input processing - deal with all remaining input before moving on.
  * Change how we get stdin's fileno -- actually grab it from the stdin handle.
........



Property changes on: branches/barnowl_unicode
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk:1-954
   + /trunk:1-957

Modified: branches/barnowl_unicode/owl/message.c
===================================================================
--- branches/barnowl_unicode/owl/message.c	2008-02-19 23:10:18 UTC (rev 957)
+++ branches/barnowl_unicode/owl/message.c	2008-02-19 23:13:25 UTC (rev 958)
@@ -661,7 +661,7 @@
 /* caller must free return value */
 char *owl_message_get_cc_without_recipient(owl_message *m)
 {
-  char *cc, *out, *end, *user, *recip;
+  char *cc, *out, *end, *user, *shortuser, *recip;
 
   cc = owl_message_get_cc(m);
   if (cc == NULL)
@@ -673,11 +673,13 @@
 
   user = strtok(cc, " ");
   while (user != NULL) {
-    if (strcasecmp(user, recip) != 0) {
+    shortuser = short_zuser(user);
+    if (strcasecmp(shortuser, recip) != 0) {
       strcpy(end, user);
       end[strlen(user)] = ' ';
       end += strlen(user) + 1;
     }
+    free(shortuser);
     user = strtok(NULL, " ");
   }
   end[0] = '\0';

Modified: branches/barnowl_unicode/owl/owl.c
===================================================================
--- branches/barnowl_unicode/owl/owl.c	2008-02-19 23:10:18 UTC (rev 957)
+++ branches/barnowl_unicode/owl/owl.c	2008-02-19 23:13:25 UTC (rev 958)
@@ -680,86 +680,88 @@
   WINDOW *typwin;
 
   typwin = owl_global_get_curs_typwin(&g);
-  j.ch = wgetch(typwin);
-  if (j.ch == ERR) return;
+  while (1) {
+    j.ch = wgetch(typwin);
+    if (j.ch == ERR) return;
+    
+    owl_global_set_lastinputtime(&g, time(NULL));
+    pw=owl_global_get_popwin(&g);
+    tw=owl_global_get_typwin(&g);
 
-  owl_global_set_lastinputtime(&g, time(NULL));
-  pw=owl_global_get_popwin(&g);
-  tw=owl_global_get_typwin(&g);
-
-  j.uch = '\0';
-  if (j.ch >= KEY_MIN && j.ch <= KEY_MAX) {
-    /* This is a curses control character. */
-  }
-  else if (j.ch > 0x7f && j.ch < 0xfe) {
-    /* Pull in a full utf-8 character. */
-    int bytes, i;
-    char utf8buf[7];
-    memset(utf8buf, '\0', 7);
-
-    utf8buf[0] = j.ch;
-
-    if ((j.ch & 0xc0) && (~j.ch & 0x20)) bytes = 2;
-    else if ((j.ch & 0xe0) && (~j.ch & 0x10)) bytes = 3;
-    else if ((j.ch & 0xf0) && (~j.ch & 0x08)) bytes = 4;
-    else if ((j.ch & 0xf8) && (~j.ch & 0x04)) bytes = 5;
-    else if ((j.ch & 0xfc) && (~j.ch & 0x02)) bytes = 6;
-    else bytes = 1;
-
-    for (i = 1; i < bytes; i++) {
-      int tmp =  wgetch(typwin);
-      /* If what we got was not a byte, or not a continuation byte */
-      if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) {
-        /* ill-formed UTF-8 code unit subsequence, put back the
-           char we just got. */
-        ungetch(tmp);
-        j.ch = ERR;
-        break;
-      }
-      utf8buf[i] = tmp;
+    j.uch = '\0';
+    if (j.ch >= KEY_MIN && j.ch <= KEY_MAX) {
+      /* This is a curses control character. */
     }
-    
-    if (j.ch != ERR) {
-      if (g_utf8_validate(utf8buf, -1, NULL)) {
-        j.uch = g_utf8_get_char(utf8buf);
+    else if (j.ch > 0x7f && j.ch < 0xfe) {
+      /* Pull in a full utf-8 character. */
+      int bytes, i;
+      char utf8buf[7];
+      memset(utf8buf, '\0', 7);
+      
+      utf8buf[0] = j.ch;
+      
+      if ((j.ch & 0xc0) && (~j.ch & 0x20)) bytes = 2;
+      else if ((j.ch & 0xe0) && (~j.ch & 0x10)) bytes = 3;
+      else if ((j.ch & 0xf0) && (~j.ch & 0x08)) bytes = 4;
+      else if ((j.ch & 0xf8) && (~j.ch & 0x04)) bytes = 5;
+      else if ((j.ch & 0xfc) && (~j.ch & 0x02)) bytes = 6;
+      else bytes = 1;
+      
+      for (i = 1; i < bytes; i++) {
+        int tmp =  wgetch(typwin);
+        /* If what we got was not a byte, or not a continuation byte */
+        if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) {
+          /* ill-formed UTF-8 code unit subsequence, put back the
+             char we just got. */
+          ungetch(tmp);
+          j.ch = ERR;
+          break;
+        }
+        utf8buf[i] = tmp;
       }
-      else {
-        j.ch = ERR;
+      
+      if (j.ch != ERR) {
+        if (g_utf8_validate(utf8buf, -1, NULL)) {
+          j.uch = g_utf8_get_char(utf8buf);
+        }
+        else {
+          j.ch = ERR;
+        }
       }
     }
+    else if (j.ch <= 0x7f) {
+      j.uch = j.ch;
+    }
+    
+    owl_global_set_lastinputtime(&g, time(NULL));
+    /* find and activate the current keymap.
+     * TODO: this should really get fixed by activating
+     * keymaps as we switch between windows... 
+     */
+    if (pw && owl_popwin_is_active(pw) && owl_global_get_viewwin(&g)) {
+      owl_context_set_popless(owl_global_get_context(&g), 
+                              owl_global_get_viewwin(&g));
+      owl_function_activate_keymap("popless");
+    } else if (owl_global_is_typwin_active(&g) 
+               && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_ONELINE) {
+      /*
+        owl_context_set_editline(owl_global_get_context(&g), tw);
+        owl_function_activate_keymap("editline");
+      */
+    } else if (owl_global_is_typwin_active(&g) 
+               && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_MULTILINE) {
+      owl_context_set_editmulti(owl_global_get_context(&g), tw);
+      owl_function_activate_keymap("editmulti");
+    } else {
+      owl_context_set_recv(owl_global_get_context(&g));
+      owl_function_activate_keymap("recv");
+    }
+    /* now actually handle the keypress */
+    ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j);
+    if (ret!=0 && ret!=1) {
+      owl_function_makemsg("Unable to handle keypress");
+    }
   }
-  else if (j.ch <= 0x7f) {
-    j.uch = j.ch;
-  }
-      
-  owl_global_set_lastinputtime(&g, time(NULL));
-  /* find and activate the current keymap.
-   * TODO: this should really get fixed by activating
-   * keymaps as we switch between windows... 
-   */
-  if (pw && owl_popwin_is_active(pw) && owl_global_get_viewwin(&g)) {
-    owl_context_set_popless(owl_global_get_context(&g), 
-                            owl_global_get_viewwin(&g));
-    owl_function_activate_keymap("popless");
-  } else if (owl_global_is_typwin_active(&g) 
-             && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_ONELINE) {
-    /*
-      owl_context_set_editline(owl_global_get_context(&g), tw);
-      owl_function_activate_keymap("editline");
-    */
-  } else if (owl_global_is_typwin_active(&g) 
-             && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_MULTILINE) {
-    owl_context_set_editmulti(owl_global_get_context(&g), tw);
-    owl_function_activate_keymap("editmulti");
-  } else {
-    owl_context_set_recv(owl_global_get_context(&g));
-    owl_function_activate_keymap("recv");
-  }
-  /* now actually handle the keypress */
-  ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j);
-  if (ret!=0 && ret!=1) {
-    owl_function_makemsg("Unable to handle keypress");
-  }
 }
 
 void sig_handler(int sig, siginfo_t *si, void *data)


home help back first fref pref prev next nref lref last post