aboutsummaryrefslogtreecommitdiff
path: root/form
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-11-09 14:08:54 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-11-09 14:08:54 +0000
commit6181f4622a00a9de81df01cecb5fa73ffdb697bc (patch)
treec963ba08ac935d7f048b78517309fe6fc2f496e6 /form
parentc0e48ca1322e978a8f9795a5ddb251df2479f930 (diff)
downloadsrc-6181f4622a00a9de81df01cecb5fa73ffdb697bc.tar.gz
src-6181f4622a00a9de81df01cecb5fa73ffdb697bc.zip
- Import ncurses 5.7-20081102 (5.7 release) onto vendor branchvendor/ncurses/5.7-20081102
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=184798 svn path=/vendor/ncurses/5.7-20081102/; revision=184799; tag=vendor/ncurses/5.7-20081102
Diffstat (limited to 'form')
-rw-r--r--form/form.priv.h6
-rw-r--r--form/frm_def.c16
-rw-r--r--form/frm_driver.c35
-rw-r--r--form/frm_req_name.c6
4 files changed, 32 insertions, 31 deletions
diff --git a/form/form.priv.h b/form/form.priv.h
index e8617f1d5747..fea627d30d7d 100644
--- a/form/form.priv.h
+++ b/form/form.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,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 *
@@ -30,7 +30,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.priv.h,v 0.26 2006/12/17 19:47:09 tom Exp $ */
+/* $Id: form.priv.h,v 0.27 2008/09/08 20:29:05 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
@@ -39,8 +39,6 @@
#include "mf_common.h"
#if USE_WIDEC_SUPPORT
-#include <wchar.h>
-
#if HAVE_WCTYPE_H
#include <wctype.h>
#endif
diff --git a/form/frm_def.c b/form/frm_def.c
index c2044a39dccd..e6897514ffdd 100644
--- a/form/frm_def.c
+++ b/form/frm_def.c
@@ -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_def.c,v 1.22 2007/10/13 19:31:17 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.23 2008/08/04 00:07:55 tom Exp $")
/* this can't be readonly */
static FORM default_form =
@@ -234,8 +234,16 @@ Connect_Fields(FORM *form, FIELD **fields)
fields[j]->page = page_nr;
fld = Insert_Field_By_Position(fields[j], fld);
}
- form->page[page_nr].smin = fld->index;
- form->page[page_nr].smax = fld->sprev->index;
+ if (fld)
+ {
+ form->page[page_nr].smin = fld->index;
+ form->page[page_nr].smax = fld->sprev->index;
+ }
+ else
+ {
+ form->page[page_nr].smin = 0;
+ form->page[page_nr].smax = 0;
+ }
}
RETURN(E_OK);
}
diff --git a/form/frm_driver.c b/form/frm_driver.c
index 0c0912576dbb..94323ed27788 100644
--- a/form/frm_driver.c
+++ b/form/frm_driver.c
@@ -32,7 +32,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.86 2008/01/19 20:11:03 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@@ -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;
@@ -4333,15 +4333,6 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
len = Buffer_Length(field);
- if (buffer == 0)
- {
- for (i = 0; (value[i] != '\0') && (i < len); ++i)
- {
- if (iscntrl(UChar(value[i])))
- RETURN(E_BAD_ARGUMENT);
- }
- }
-
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
@@ -4356,14 +4347,6 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
* field->cols))))
RETURN(E_SYSTEM_ERROR);
- /* in this case we also have to check, whether or not the remaining
- characters in value are also printable for buffer 0. */
- if (buffer == 0)
- {
- for (i = len; i < vlen; i++)
- if (iscntrl(UChar(value[i])))
- RETURN(E_BAD_ARGUMENT);
- }
len = vlen;
}
}
@@ -4376,6 +4359,13 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
* There should be a better way, but this handles nonspacing characters
* and other special cases that we really do not want to handle here.
*/
+#if NCURSES_EXT_FUNCS
+ if (wresize(field->working, field->drows, field->dcols) == ERR)
+#endif
+ {
+ delwin(field->working);
+ field->working = newpad(field->drows, field->dcols);
+ }
wclear(field->working);
mvwaddstr(field->working, 0, 0, value);
@@ -4385,7 +4375,12 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
}
else
{
- mvwin_wchnstr(field->working, 0, 0, widevalue, (int)len);
+ for (i = 0; i < (unsigned)field->drows; ++i)
+ {
+ mvwin_wchnstr(field->working, i, 0,
+ widevalue + (i * field->dcols),
+ field->dcols);
+ }
for (i = 0; i < len; ++i)
{
if (CharEq(myZEROS, widevalue[i]))
diff --git a/form/frm_req_name.c b/form/frm_req_name.c
index e4d5c335d8ec..7ac9abe6e299 100644
--- a/form/frm_req_name.c
+++ b/form/frm_req_name.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,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 *
@@ -37,7 +37,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: frm_req_name.c,v 1.15 2005/04/16 16:59:27 tom Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.16 2008/07/05 23:22:08 tom Exp $")
static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] =
{
@@ -154,7 +154,7 @@ form_request_by_name(const char *str)
strncpy(buf, str, sizeof(buf));
while ((i < sizeof(buf)) && (buf[i] != '\0'))
{
- buf[i] = toupper(buf[i]);
+ buf[i] = toupper(UChar(buf[i]));
i++;
}