]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/frm_driver.c
ncurses 5.6 - patch 20080712
[ncurses.git] / form / frm_driver.c
index cc7eb6e1af4dc10044ad80eda8ce81a8f2dcdc90..5208113010ccdf8c39b9e287dea6e9f9d780c806 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.84 2007/10/13 19:26:54 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.87 2008/07/12 21:24:07 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -676,7 +676,7 @@ Field_Grown(FIELD *field, int amount)
              new_bp[new_buflen] = myZEROS;
            }
 
-#if USE_WIDEC_SUPPORT
+#if USE_WIDEC_SUPPORT && NCURSES_EXT_FUNCS
          if (wresize(field->working, 1, Buffer_Length(field) + 1) == ERR)
            result = FALSE;
 #endif
@@ -4176,7 +4176,7 @@ form_driver(FORM *form, int c)
        NULL                    /* Choice Request is generic           */
       };
       size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
-      size_t method = ((BI->keycode & ID_Mask) >> ID_Shft) & 0xffff;
+      size_t method = (BI->keycode >> ID_Shft) & 0xffff;       /* see ID_Mask */
 
       if ((method >= nMethods) || !(BI->cmd))
        res = E_SYSTEM_ERROR;
@@ -4459,10 +4459,7 @@ field_buffer(const FIELD *field, int buffer)
              init_mb(state);
              next = _nc_wcrtomb(0, data[n].chars[0], &state);
              if (!isEILSEQ(next))
-               {
-                 if (next != 0)
-                   need += next;
-               }
+               need += next;
            }
        }