Changeset 4006

Show
Ignore:
Timestamp:
12/28/05 01:40:42 (3 years ago)
Author:
horiguti
Message:

Bug fix about multibyte characters in exec file.
Related to ticket:268.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/ChangeLog.Meadow

    r4005 r4006  
    55        redisplay-dont-pause when calling sit-for. Preserve 
    66        buffer-modified-p. 
     7 
     8        * international/mw32misc.el (general-process-argument-editing-function): 
     9        Bug fix about wrapper function. 
    710 
    8112005-12-14  Hideyuki SHIRAI  <shirai@meadowy.org> 
  • trunk/lisp/international/mw32misc.el

    r3947 r4006  
    969969      (setq argument (cons wrapper argument))) 
    970970     ((consp wrapper) 
    971       (setq argument (cons (car wrapper) argument)) 
    972       (funcall (cdr wrapper)) 
    973       (setq wrapper (car wrapper)))) 
     971      (let ((prog (car wrapper)) 
     972            (func (cdr wrapper))) 
     973      (if (stringp prog) 
     974          (setq argument (cons prog argument))) 
     975      (if (functionp func) 
     976          (funcall func)) 
     977      (setq wrapper prog)))) 
    974978     
    975979    (setq argument (cond ((eq quoting 'msvc) 
     
    985989          (cons wrapper 
    986990                (concat 
    987                  (unix-to-dos-filename (car argument)) " " 
     991                 (unix-to-dos-filename 
     992                  (encode-coding-string 
     993                   (car argument) 
     994                   (or file-name-coding-system 
     995                       default-file-name-coding-system))) 
     996                 " " 
    988997                 (unix-to-dos-argument (mapconcat (function concat) 
    989998                                                  (cdr argument) " ") 
  • trunk/src/ChangeLog.Meadow

    r4005 r4006  
    2929        (mw32_WndProc<WM_IME_NOTIFY>): Set event when FEP switched. 
    3030        (mw32_WndProc<WM_IME_REPORT>): Set event when FEP switched. 
     31 
     32        * w32proc.c: New include charset.h, coding.h. 
     33        (sys_spawnve): Properly handle multibyte characters and path 
     34        separator. 
    3135 
    32362005-12-25  Masayuki FUJII  <boochang@m4.kcn.ne.jp> 
  • trunk/src/w32proc.c

    r3991 r4006  
    5353#include "w32.h" 
    5454/* Meadow don't use w32heap.h */ 
    55 #ifndef MEADOW 
     55#ifdef MEADOW 
     56#include "charset.h" 
     57#include "coding.h" 
     58#else 
    5659#include "w32heap.h" 
    5760#endif 
     
    756759  char *extra_env[] = {ppid_env_var_buffer, NULL}; 
    757760  char *sepchars = " \t"; 
    758  
    759761#ifdef MEADOW 
     762  Lisp_Object decoded_program; 
     763 
    760764  /* duplicate the whole elements of `argv' to prevent errors in GC. 
    761765   */ 
     
    778782  program = make_string (cmdname, strlen (cmdname)); 
    779783#ifdef MEADOW 
    780     { 
    781       struct gcpro gcpro1; 
    782  
    783       full = Qnil; 
    784       GCPRO1 (program); 
    785       openp (Vexec_path, program, Vexec_suffixes, &full, make_number (X_OK)); 
    786       UNGCPRO; 
    787       if (!NILP (full)) 
    788         program = full; 
    789     } 
     784  decoded_program = Fdos_to_unix_filename (DECODE_FILE (program)); 
     785  { 
     786    struct gcpro gcpro1, gcpro2; 
     787 
     788    full = Qnil; 
     789    GCPRO2 (program, decoded_program); 
     790    openp (Vexec_path, decoded_program, 
     791           Vexec_suffixes, &full, make_number (X_OK)); 
     792    UNGCPRO; 
     793    if (!NILP (full)) 
     794      { 
     795        decoded_program = full; 
     796        program = Funix_to_dos_filename (ENCODE_FILE (full)); 
     797      } 
     798  } 
    790799#else /* not MEADOW */ 
    791800  if (NILP (Ffile_executable_p (program))) 
     
    845854#ifdef MEADOW 
    846855  { 
    847     char *new_cmdname; 
    848     Lisp_Object func, arg, result; 
    849     new_cmdname = alloca (strlen (cmdname) + 1); 
    850     strcpy (new_cmdname, cmdname); 
    851     dostounix_filename (new_cmdname); 
     856    Lisp_Object func, arg, result, decoded_cmdname; 
     857 
    852858    func = call1 (intern ("find-process-argument-editing-function"), 
    853                   build_string (new_cmdname)); 
     859                  decoded_program); 
    854860    if (NILP (func)) 
    855861      { 
     
    871877        *--parg = '\0'; 
    872878 
    873         cmdname = new_cmdname; 
    874879        argv[0] = cmdname; 
    875880      } 
     
    890895          { 
    891896            int size; 
    892  
    893             CHECK_STRING (XCONS (result)->car); 
    894             CHECK_STRING (XCONS (result)->u.cdr); 
    895             cmdline = XSTRING (XCONS (result)->u.cdr)->data; 
    896             size = STRING_BYTES (XSTRING (XCONS (result)->car)) + 1; 
     897            Lisp_Object cmd, rcar, rcdr; 
     898 
     899            rcar = XCAR (result); 
     900            rcdr = XCDR (result); 
     901            CHECK_STRING (rcar); 
     902            CHECK_STRING (rcdr); 
     903            cmdline = SDATA (rcdr); 
     904            cmd = Funix_to_dos_filename (ENCODE_FILE (rcar)); 
     905            size = SBYTES (cmd) + 1; 
    897906            cmdname = alloca (size); 
    898             memcpy (cmdname, XSTRING (XCONS (result)->car)->data, size); 
     907            memcpy (cmdname, SDATA (cmd), size); 
    899908          } 
    900909        else 
    901910          { 
    902911            CHECK_STRING (result); 
    903             cmdline = XSTRING (result)->data
    904             cmdname = new_cmdname
     912            cmdline = SDATA (result)
     913            cmdname = SDATA (program)
    905914          } 
    906915      } 
    907     /*    printf ("cmdline:%s\n", cmdline); */ 
    908     dostounix_filename (cmdname); 
    909916 
    910917    /* Checks whether the cmdname exists. */ 
    911     program = build_string (cmdname); 
    912918    { 
    913919      struct gcpro gcpro1; 
    914920 
    915921      GCPRO1 (program); 
    916       openp (Vexec_path, program, Vexec_suffixes, &full, make_number (X_OK)); 
    917       UNGCPRO; 
     922      openp (Vexec_path, decoded_program, 
     923             Vexec_suffixes, &full, make_number (X_OK)); 
     924      UNGCPRO   ; 
    918925      if (NILP (full)) 
    919926        { 
     
    924931        } 
    925932    } 
    926  
    927     unixtodos_filename (cmdname); 
    928933  } 
    929934#else /* not MEADOW */