1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

init.c: upstream init.c.patch for CDE's dtksh

This upstreams the patch to init.c that is necessary to build dtksh
(graphical extensions for CDE, see <https://cdesktopenv.sf.net/>).
It has no effect when building regular ksh. Upstreaming it avoids
the need to keep updating it when changes to init.c are made.
This commit is contained in:
Martijn Dekker 2021-12-31 18:13:20 +00:00
parent 336e82f942
commit d9fc61c022

View file

@ -49,6 +49,27 @@
#include "lexstates.h"
#include "version.h"
#ifdef BUILD_DTKSH
#include <Dt/DtNlUtils.h>
#include <Dt/EnvControlP.h>
#include <X11/X.h>
#include <X11/Intrinsic.h>
#include <X11/IntrinsicP.h>
#include <X11/CoreP.h>
#include <X11/StringDefs.h>
#include <Xm/XmStrDefs.h>
#include <Xm/Xm.h>
#include <Xm/Protocols.h>
#include "dtksh.h"
#include "xmksh.h"
#include "dtkcmds.h"
#include "xmcvt.h"
#include "widget.h"
#include "extra.h"
#include "xmwidgets.h"
#include "msgs.h"
#endif /* BUILD_DTKSH */
#if _hdr_wctype
#include <ast_wchar.h>
#include <wctype.h>
@ -1480,6 +1501,16 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit)
shp->errtrap = 0;
shp->end_fn = 0;
error_info.exit = sh_exit;
#ifdef BUILD_DTKSH
{
int *lockedFds = LockKshFileDescriptors();
(void) XtSetLanguageProc((XtAppContext)NULL, (XtLanguageProc)NULL, (XtPointer)NULL);
DtNlInitialize();
_DtEnvControl(DT_ENV_SET);
UnlockKshFileDescriptors(lockedFds);
dtksh_init();
}
#endif /* BUILD_DTKSH */
return(shp);
}