summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/form
diff options
context:
space:
mode:
authorBerk Geveci <berk.geveci@kitware.com>2001-11-09 21:05:33 (GMT)
committerBerk Geveci <berk.geveci@kitware.com>2001-11-09 21:05:33 (GMT)
commit23f0b7760f862c1befa2c7b327acec9910abbcee (patch)
tree34ff122ad9a0c092a5eea4ceb3eefaf3e44e6302 /Source/CursesDialog/form
parent722283804b7d3b04e90daac84465c53130748ee0 (diff)
downloadCMake-23f0b7760f862c1befa2c7b327acec9910abbcee.zip
CMake-23f0b7760f862c1befa2c7b327acec9910abbcee.tar.gz
CMake-23f0b7760f862c1befa2c7b327acec9910abbcee.tar.bz2
Trying to fix curses.
Diffstat (limited to 'Source/CursesDialog/form')
-rw-r--r--Source/CursesDialog/form/frm_driver.c22
-rw-r--r--Source/CursesDialog/form/frm_req_name.c11
2 files changed, 22 insertions, 11 deletions
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c
index f80b9a4..cc07b65 100644
--- a/Source/CursesDialog/form/frm_driver.c
+++ b/Source/CursesDialog/form/frm_driver.c
@@ -29,12 +29,13 @@
/****************************************************************************
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
****************************************************************************/
-#define _XOPEN_SOURCE_EXTENDED
-#ifdef __FreeBSD__
- #define _WCHAR_T
-#endif /* __FreeBSD__ */
+#if defined(__hpux)
+ #define _XOPEN_SOURCE_EXTENDED
+#endif
#include "form.priv.h"
-#undef _XOPEN_SOURCE_EXTENDED
+#if defined(__hpux)
+ #undef _XOPEN_SOURCE_EXTENDED
+#endif
MODULE_ID("$Id$")
@@ -1994,7 +1995,10 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
int requiredlen = len+1;
char *split;
int result = E_REQUEST_DENIED;
- const char *Space = " ";
+ char *Space;
+
+ Space = (char*)malloc(2*sizeof(char));
+ strcpy(Space, " ");
if (freelen >= requiredlen)
{
@@ -2002,6 +2006,7 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
winsnstr(form->w,txt,len);
wmove(form->w,row,len);
winsnstr(form->w,Space,1);
+ free(Space);
return E_OK;
}
else
@@ -2010,7 +2015,10 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
if ((row == (field->drows - 1)) && Growable(field))
{
if (!Field_Grown(field,1))
+ {
+ free(Space);
return(E_SYSTEM_ERROR);
+ }
/* !!!Side-Effect : might be changed due to growth!!! */
bp = Address_Of_Row_In_Buffer(field,row);
}
@@ -2033,9 +2041,11 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
winsnstr(form->w,txt,len);
wmove(form->w,row,len);
winsnstr(form->w,Space,1);
+ free(Space);
return E_OK;
}
}
+ free(Space);
return(result);
}
}
diff --git a/Source/CursesDialog/form/frm_req_name.c b/Source/CursesDialog/form/frm_req_name.c
index 6190c4b..0c0755b 100644
--- a/Source/CursesDialog/form/frm_req_name.c
+++ b/Source/CursesDialog/form/frm_req_name.c
@@ -35,12 +35,13 @@
* Routines to handle external names of menu requests *
***************************************************************************/
-#define _XOPEN_SOURCE_EXTENDED
-#ifdef __FreeBSD__
- #define _WCHAR_T
-#endif /* __FreeBSD__ */
+#if defined(__hpux)
+ #define _XOPEN_SOURCE_EXTENDED
+#endif
#include "form.priv.h"
-#undef _XOPEN_SOURCE_EXTENDED
+#if defined(__hpux)
+ #undef _XOPEN_SOURCE_EXTENDED
+#endif
MODULE_ID("$Id$")