diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-08-24 18:22:23 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-08-24 18:22:23 +0800 |
commit | ecdd438f41608e620486f1d798d84a5afec9db23 (patch) | |
tree | 35a54598af486b4d68d12a6773b33f2bc052a6f0 /lang | |
parent | 0a99ce83faf9a8eddc8ff425811f6377433aab51 (diff) | |
download | freebsd-ports-gnome-ecdd438f41608e620486f1d798d84a5afec9db23.tar.gz freebsd-ports-gnome-ecdd438f41608e620486f1d798d84a5afec9db23.tar.zst freebsd-ports-gnome-ecdd438f41608e620486f1d798d84a5afec9db23.zip |
Properly convert command-line arguments into UTF-8 before passing them
to TCL interpreter, othervise arguments in any encoding other than
ASCII are becoming ????, even when LANG or LC_CTYPE is defined properly.
Problem reported by: Alex V. Belinsky <fozzy@kievweb.net.ua>
Diffstat (limited to 'lang')
-rw-r--r-- | lang/expect/Makefile | 1 | ||||
-rw-r--r-- | lang/expect/files/patch-exp_main_sub.c | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/lang/expect/Makefile b/lang/expect/Makefile index 0351355b5fee..c2a75c5d9be8 100644 --- a/lang/expect/Makefile +++ b/lang/expect/Makefile @@ -6,6 +6,7 @@ PORTNAME= expect PORTVERSION= 5.38.0 +PORTREVISION= 1 CATEGORIES= lang tcl83 tk83 MASTER_SITES= http://expect.nist.gov/src/ diff --git a/lang/expect/files/patch-exp_main_sub.c b/lang/expect/files/patch-exp_main_sub.c new file mode 100644 index 000000000000..c3cf7aadbe9e --- /dev/null +++ b/lang/expect/files/patch-exp_main_sub.c @@ -0,0 +1,42 @@ + +$FreeBSD$ + +--- exp_main_sub.c 2002/08/24 08:04:43 1.1 ++++ exp_main_sub.c 2002/08/24 08:15:33 +@@ -593,6 +593,9 @@ + char *args; /* ptr to string-rep of all args */ + char *debug_init; + ++ char *native; ++ Tcl_DString ds; ++ + exp_argv0 = argv[0]; + + #ifdef TCL_DEBUGGER +@@ -768,18 +771,23 @@ + expDiagLog("set argc %s\r\n",argc_rep); + + if (exp_cmdfilename) { +- Tcl_SetVar(interp,"argv0",exp_cmdfilename,0); ++ native = Tcl_ExternalToUtfDString(NULL, exp_cmdfilename, -1, &ds); ++ Tcl_SetVar(interp,"argv0",native,0); + expDiagLog("set argv0 \"%s\"\r\n",exp_cmdfilename); + } else { +- Tcl_SetVar(interp,"argv0",exp_argv0,0); ++ native = Tcl_ExternalToUtfDString(NULL, exp_argv0, -1, &ds); ++ Tcl_SetVar(interp,"argv0",native,0); + expDiagLog("set argv0 \"%s\"\r\n",exp_argv0); + } ++ Tcl_DStringFree(&ds); + + args = Tcl_Merge(argc-optind,argv+optind); + expDiagLogU("set argv \""); + expDiagLogU(args); + expDiagLogU("\"\r\n"); +- Tcl_SetVar(interp,"argv",args,0); ++ native = Tcl_ExternalToUtfDString(NULL, args, -1, &ds); ++ Tcl_SetVar(interp,"argv",native,0); ++ Tcl_DStringFree(&ds); + Tcl_Free(args); + + exp_interpret_rcfiles(interp,my_rc,sys_rc); |