/[emacs]/emacs/src/callproc.c
ViewVC logotype

Diff of /emacs/src/callproc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.187 by walters, Fri May 3 20:40:58 2002 UTC revision 1.187.2.1 by miles, Fri Apr 4 06:20:57 2003 UTC
# Line 159  call_process_cleanup (fdpid) Line 159  call_process_cleanup (fdpid)
159    register Lisp_Object file;    register Lisp_Object file;
160    file = Fcdr (fdpid);    file = Fcdr (fdpid);
161    emacs_close (XFASTINT (Fcar (fdpid)));    emacs_close (XFASTINT (Fcar (fdpid)));
162    if (strcmp (XSTRING (file)-> data, NULL_DEVICE) != 0)    if (strcmp (SDATA (file), NULL_DEVICE) != 0)
163      unlink (XSTRING (file)->data);      unlink (SDATA (file));
164  #else /* not MSDOS and not MAC_OS8 */  #else /* not MSDOS and not MAC_OS8 */
165    register int pid = XFASTINT (Fcdr (fdpid));    register int pid = XFASTINT (Fcdr (fdpid));
166    
# Line 172  call_process_cleanup (fdpid) Line 172  call_process_cleanup (fdpid)
172    
173    if (EMACS_KILLPG (pid, SIGINT) == 0)    if (EMACS_KILLPG (pid, SIGINT) == 0)
174      {      {
175        int count = specpdl_ptr - specpdl;        int count = SPECPDL_INDEX ();
176        record_unwind_protect (call_process_kill, fdpid);        record_unwind_protect (call_process_kill, fdpid);
177        message1 ("Waiting for process to die...(type C-g again to kill it instantly)");        message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
178        immediate_quit = 1;        immediate_quit = 1;
# Line 220  usage: (call-process PROGRAM &optional I Line 220  usage: (call-process PROGRAM &optional I
220    char buf[16384];    char buf[16384];
221    char *bufptr = buf;    char *bufptr = buf;
222    int bufsize = 16384;    int bufsize = 16384;
223    int count = specpdl_ptr - specpdl;    int count = SPECPDL_INDEX ();
224    
225    register unsigned char **new_argv    register const unsigned char **new_argv
226      = (unsigned char **) alloca ((max (2, nargs - 2)) * sizeof (char *));      = (const unsigned char **) alloca ((max (2, nargs - 2)) * sizeof (char *));
227    struct buffer *old = current_buffer;    struct buffer *old = current_buffer;
228    /* File to use for stderr in the child.    /* File to use for stderr in the child.
229       t means use same as standard output.  */       t means use same as standard output.  */
# Line 253  usage: (call-process PROGRAM &optional I Line 253  usage: (call-process PROGRAM &optional I
253    
254  #ifndef subprocesses  #ifndef subprocesses
255    /* Without asynchronous processes we cannot have BUFFER == 0.  */    /* Without asynchronous processes we cannot have BUFFER == 0.  */
256    if (nargs >= 3    if (nargs >= 3
257        && (INTEGERP (CONSP (args[2]) ? XCAR (args[2]) : args[2])))        && (INTEGERP (CONSP (args[2]) ? XCAR (args[2]) : args[2])))
258      error ("Operating system cannot handle asynchronous subprocesses");      error ("Operating system cannot handle asynchronous subprocesses");
259  #endif /* subprocesses */  #endif /* subprocesses */
# Line 339  usage: (call-process PROGRAM &optional I Line 339  usage: (call-process PROGRAM &optional I
339            CHECK_BUFFER (buffer);            CHECK_BUFFER (buffer);
340          }          }
341      }      }
342    else    else
343      buffer = Qnil;      buffer = Qnil;
344    
345    /* Make sure that the child will be able to chdir to the current    /* Make sure that the child will be able to chdir to the current
# Line 371  usage: (call-process PROGRAM &optional I Line 371  usage: (call-process PROGRAM &optional I
371    
372    display = nargs >= 4 ? args[3] : Qnil;    display = nargs >= 4 ? args[3] : Qnil;
373    
374    filefd = emacs_open (XSTRING (infile)->data, O_RDONLY, 0);    filefd = emacs_open (SDATA (infile), O_RDONLY, 0);
375    if (filefd < 0)    if (filefd < 0)
376      {      {
377        report_file_error ("Opening process input file", Fcons (infile, Qnil));        report_file_error ("Opening process input file", Fcons (infile, Qnil));
# Line 389  usage: (call-process PROGRAM &optional I Line 389  usage: (call-process PROGRAM &optional I
389        emacs_close (filefd);        emacs_close (filefd);
390        report_file_error ("Searching for program", Fcons (args[0], Qnil));        report_file_error ("Searching for program", Fcons (args[0], Qnil));
391      }      }
392    new_argv[0] = XSTRING (path)->data;  
393      /* If program file name starts with /: for quoting a magic name,
394         discard that.  */
395      if (SBYTES (path) > 2 && SREF (path, 0) == '/'
396          && SREF (path, 1) == ':')
397        path = Fsubstring (path, make_number (2), Qnil);
398    
399      new_argv[0] = SDATA (path);
400    if (nargs > 4)    if (nargs > 4)
401      {      {
402        register int i;        register int i;
# Line 407  usage: (call-process PROGRAM &optional I Line 414  usage: (call-process PROGRAM &optional I
414                if (argument_coding.type == coding_type_ccl)                if (argument_coding.type == coding_type_ccl)
415                  setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil);                  setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil);
416              }              }
417            new_argv[i - 3] = XSTRING (args[i])->data;            new_argv[i - 3] = SDATA (args[i]);
418          }          }
419        UNGCPRO;        UNGCPRO;
420        new_argv[nargs - 3] = 0;        new_argv[nargs - 3] = 0;
# Line 424  usage: (call-process PROGRAM &optional I Line 431  usage: (call-process PROGRAM &optional I
431        *tempfile = '\0';        *tempfile = '\0';
432      }      }
433    dostounix_filename (tempfile);    dostounix_filename (tempfile);
434    if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')    if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
435      strcat (tempfile, "/");      strcat (tempfile, "/");
436    strcat (tempfile, "detmp.XXX");    strcat (tempfile, "detmp.XXX");
437    mktemp (tempfile);    mktemp (tempfile);
# Line 443  usage: (call-process PROGRAM &optional I Line 450  usage: (call-process PROGRAM &optional I
450  #ifdef MAC_OS8  #ifdef MAC_OS8
451    /* Since we don't have pipes on the Mac, create a temporary file to    /* Since we don't have pipes on the Mac, create a temporary file to
452       hold the output of the subprocess.  */       hold the output of the subprocess.  */
453    tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);    tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1);
454    bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile,    bcopy (SDATA (Vtemp_file_name_pattern), tempfile,
455           STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);           SBYTES (Vtemp_file_name_pattern) + 1);
456    
457    mktemp (tempfile);    mktemp (tempfile);
458    
# Line 505  usage: (call-process PROGRAM &optional I Line 512  usage: (call-process PROGRAM &optional I
512      else if (STRINGP (error_file))      else if (STRINGP (error_file))
513        {        {
514  #ifdef DOS_NT  #ifdef DOS_NT
515          fd_error = emacs_open (XSTRING (error_file)->data,          fd_error = emacs_open (SDATA (error_file),
516                                 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT,                                 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT,
517                                 S_IREAD | S_IWRITE);                                 S_IREAD | S_IWRITE);
518  #else  /* not DOS_NT */  #else  /* not DOS_NT */
519          fd_error = creat (XSTRING (error_file)->data, 0666);          fd_error = creat (SDATA (error_file), 0666);
520  #endif /* not DOS_NT */  #endif /* not DOS_NT */
521        }        }
522    
# Line 538  usage: (call-process PROGRAM &optional I Line 545  usage: (call-process PROGRAM &optional I
545           code does not handle passing the environment to the synchronous           code does not handle passing the environment to the synchronous
546           Mac subprocess.  */           Mac subprocess.  */
547        char *infn, *outfn, *errfn, *currdn;        char *infn, *outfn, *errfn, *currdn;
548          
549        /* close these files so subprocess can write to them */        /* close these files so subprocess can write to them */
550        close (outfilefd);        close (outfilefd);
551        if (fd_error != outfilefd)        if (fd_error != outfilefd)
552          close (fd_error);          close (fd_error);
553        fd1 = -1; /* No harm in closing that one! */        fd1 = -1; /* No harm in closing that one! */
554    
555        infn = XSTRING (infile)->data;        infn = SDATA (infile);
556        outfn = tempfile;        outfn = tempfile;
557        if (NILP (error_file))        if (NILP (error_file))
558          errfn = NULL_DEVICE;          errfn = NULL_DEVICE;
559        else if (EQ (Qt, error_file))        else if (EQ (Qt, error_file))
560          errfn = outfn;          errfn = outfn;
561        else        else
562          errfn = XSTRING (error_file)->data;          errfn = SDATA (error_file);
563        currdn = XSTRING (current_dir)->data;        currdn = SDATA (current_dir);
564        pid = run_mac_command (new_argv, currdn, infn, outfn, errfn);        pid = run_mac_command (new_argv, currdn, infn, outfn, errfn);
565    
566        /* Record that the synchronous process exited and note its        /* Record that the synchronous process exited and note its
# Line 773  usage: (call-process PROGRAM &optional I Line 780  usage: (call-process PROGRAM &optional I
780    
781          /* Now NREAD is the total amount of data in the buffer.  */          /* Now NREAD is the total amount of data in the buffer.  */
782          immediate_quit = 0;          immediate_quit = 0;
783            
784          if (!NILP (buffer))          if (!NILP (buffer))
785            {            {
786              if (! CODING_MAY_REQUIRE_DECODING (&process_coding))              if (! CODING_MAY_REQUIRE_DECODING (&process_coding))
# Line 786  usage: (call-process PROGRAM &optional I Line 793  usage: (call-process PROGRAM &optional I
793                repeat_decoding:                repeat_decoding:
794                  size = decoding_buffer_size (&process_coding, nread);                  size = decoding_buffer_size (&process_coding, nread);
795                  decoding_buf = (char *) xmalloc (size);                  decoding_buf = (char *) xmalloc (size);
796                    
797                    /* We can't use the macro CODING_REQUIRE_DETECTION
798                       because it always returns nonzero if the coding
799                       system requires EOL detection.  Here, we have to
800                       check only whether or not the coding system
801                       requires text-encoding detection.  */
802                    if (process_coding.type == coding_type_undecided)
803                      {
804                        detect_coding (&process_coding, bufptr, nread);
805                        if (process_coding.composing != COMPOSITION_DISABLED)
806                          coding_allocate_composition_data (&process_coding, PT);
807                      }
808                  if (process_coding.cmp_data)                  if (process_coding.cmp_data)
809                    process_coding.cmp_data->char_offset = PT;                    process_coding.cmp_data->char_offset = PT;
810                    
811                  decode_coding (&process_coding, bufptr, decoding_buf,                  decode_coding (&process_coding, bufptr, decoding_buf,
812                                 nread, size);                                 nread, size);
813                    
814                  if (display_on_the_fly                  if (display_on_the_fly
815                      && saved_coding.type == coding_type_undecided                      && saved_coding.type == coding_type_undecided
816                      && process_coding.type != coding_type_undecided)                      && process_coding.type != coding_type_undecided)
# Line 807  usage: (call-process PROGRAM &optional I Line 825  usage: (call-process PROGRAM &optional I
825                      carryover = nread;                      carryover = nread;
826                      continue;                      continue;
827                    }                    }
828                    
829                  if (process_coding.produced > 0)                  if (process_coding.produced > 0)
830                    insert_1_both (decoding_buf, process_coding.produced_char,                    insert_1_both (decoding_buf, process_coding.produced_char,
831                                   process_coding.produced, 0, 1, 0);                                   process_coding.produced, 0, 1, 0);
# Line 822  usage: (call-process PROGRAM &optional I Line 840  usage: (call-process PROGRAM &optional I
840                          /* CRs have been replaced with LFs.  Undo                          /* CRs have been replaced with LFs.  Undo
841                             that in the text inserted above.  */                             that in the text inserted above.  */
842                          unsigned char *p;                          unsigned char *p;
843                            
844                          move_gap_both (PT, PT_BYTE);                          move_gap_both (PT, PT_BYTE);
845                            
846                          p = BYTE_POS_ADDR (pt_byte_orig);                          p = BYTE_POS_ADDR (pt_byte_orig);
847                          for (; p < GPT_ADDR; ++p)                          for (; p < GPT_ADDR; ++p)
848                            if (*p == '\n')                            if (*p == '\n')
# Line 840  usage: (call-process PROGRAM &optional I Line 858  usage: (call-process PROGRAM &optional I
858                          old_pt = PT;                          old_pt = PT;
859                          old_pt_byte = PT_BYTE;                          old_pt_byte = PT_BYTE;
860                          nCR = 0;                          nCR = 0;
861                            
862                          for (bytepos = PT_BYTE - 1;                          for (bytepos = PT_BYTE - 1;
863                               bytepos >= pt_byte_orig;                               bytepos >= pt_byte_orig;
864                               --bytepos)                               --bytepos)
# Line 864  usage: (call-process PROGRAM &optional I Line 882  usage: (call-process PROGRAM &optional I
882                        coding = AREF (eol_type, CODING_EOL_LF);                        coding = AREF (eol_type, CODING_EOL_LF);
883                      else                      else
884                        coding = saved_coding.symbol;                        coding = saved_coding.symbol;
885                        
886                      process_coding.symbol = coding;                      process_coding.symbol = coding;
887                      process_coding.eol_type = CODING_EOL_LF;                      process_coding.eol_type = CODING_EOL_LF;
888                      process_coding.mode                      process_coding.mode
889                        &= ~CODING_MODE_INHIBIT_INCONSISTENT_EOL;                        &= ~CODING_MODE_INHIBIT_INCONSISTENT_EOL;
890                    }                    }
891                    
892                  nread -= process_coding.consumed;                  nread -= process_coding.consumed;
893                  carryover = nread;                  carryover = nread;
894                  if (carryover > 0)                  if (carryover > 0)
# Line 925  usage: (call-process PROGRAM &optional I Line 943  usage: (call-process PROGRAM &optional I
943        }        }
944    
945      {      {
946        int post_read_count = specpdl_ptr - specpdl;        int post_read_count = SPECPDL_INDEX ();
947    
948        record_unwind_protect (save_excursion_restore, save_excursion_save ());        record_unwind_protect (save_excursion_restore, save_excursion_save ());
949        inserted = PT - pt_orig;        inserted = PT - pt_orig;
# Line 1006  usage: (call-process-region START END PR Line 1024  usage: (call-process-region START END PR
1024    struct gcpro gcpro1;    struct gcpro gcpro1;
1025    Lisp_Object filename_string;    Lisp_Object filename_string;
1026    register Lisp_Object start, end;    register Lisp_Object start, end;
1027    int count = specpdl_ptr - specpdl;    int count = SPECPDL_INDEX ();
1028    /* Qt denotes we have not yet called Ffind_operation_coding_system.  */    /* Qt denotes we have not yet called Ffind_operation_coding_system.  */
1029    Lisp_Object coding_systems;    Lisp_Object coding_systems;
1030    Lisp_Object val, *args2;    Lisp_Object val, *args2;
# Line 1036  usage: (call-process-region START END PR Line 1054  usage: (call-process-region START END PR
1054    strcat (tempfile, "detmp.XXX");    strcat (tempfile, "detmp.XXX");
1055  #endif  #endif
1056  #else /* not DOS_NT */  #else /* not DOS_NT */
1057    char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);    char *tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1);
1058    bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile,    bcopy (SDATA (Vtemp_file_name_pattern), tempfile,
1059           STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);           SBYTES (Vtemp_file_name_pattern) + 1);
1060  #endif /* not DOS_NT */  #endif /* not DOS_NT */
1061    
1062    coding_systems = Qt;    coding_systems = Qt;
# Line 1080  usage: (call-process-region START END PR Line 1098  usage: (call-process-region START END PR
1098      }      }
1099    
1100    {    {
1101      int count1 = specpdl_ptr - specpdl;      int count1 = SPECPDL_INDEX ();
1102    
1103      specbind (intern ("coding-system-for-write"), val);      specbind (intern ("coding-system-for-write"), val);
1104      Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil);      Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil);
# Line 1088  usage: (call-process-region START END PR Line 1106  usage: (call-process-region START END PR
1106      unbind_to (count1, Qnil);      unbind_to (count1, Qnil);
1107    }    }
1108    
1109    /* Note that Fcall_process takes care of binding    /* Note that Fcall_process takes care of binding
1110       coding-system-for-read.  */       coding-system-for-read.  */
1111    
1112    record_unwind_protect (delete_temp_file, filename_string);    record_unwind_protect (delete_temp_file, filename_string);
# Line 1126  static int relocate_fd (); Line 1144  static int relocate_fd ();
1144     of environ around the vfork and the call to this function.     of environ around the vfork and the call to this function.
1145    
1146     SET_PGRP is nonzero if we should put the subprocess into a separate     SET_PGRP is nonzero if we should put the subprocess into a separate
1147     process group.       process group.
1148    
1149     CURRENT_DIR is an elisp string giving the path of the current     CURRENT_DIR is an elisp string giving the path of the current
1150     directory the subprocess should have.  Since we can't really signal     directory the subprocess should have.  Since we can't really signal
# Line 1177  child_setup (in, out, err, new_argv, set Line 1195  child_setup (in, out, err, new_argv, set
1195      register char *temp;      register char *temp;
1196      register int i;      register int i;
1197    
1198      i = STRING_BYTES (XSTRING (current_dir));      i = SBYTES (current_dir);
1199  #ifdef MSDOS  #ifdef MSDOS
1200      /* MSDOS must have all environment variables malloc'ed, because      /* MSDOS must have all environment variables malloc'ed, because
1201         low-level libc functions that launch subsidiary processes rely         low-level libc functions that launch subsidiary processes rely
# Line 1188  child_setup (in, out, err, new_argv, set Line 1206  child_setup (in, out, err, new_argv, set
1206  #endif  #endif
1207      temp = pwd_var + 4;      temp = pwd_var + 4;
1208      bcopy ("PWD=", pwd_var, 4);      bcopy ("PWD=", pwd_var, 4);
1209      bcopy (XSTRING (current_dir)->data, temp, i);      bcopy (SDATA (current_dir), temp, i);
1210      if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP;      if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP;
1211      temp[i] = 0;      temp[i] = 0;
1212    
# Line 1242  child_setup (in, out, err, new_argv, set Line 1260  child_setup (in, out, err, new_argv, set
1260           tem = XCDR (tem))           tem = XCDR (tem))
1261        {        {
1262          char **ep = env;          char **ep = env;
1263          char *string = (char *) XSTRING (XCAR (tem))->data;          char *string = (char *) SDATA (XCAR (tem));
1264          /* See if this string duplicates any string already in the env.          /* See if this string duplicates any string already in the env.
1265             If so, don't put it in.             If so, don't put it in.
1266             When an env var has multiple definitions,             When an env var has multiple definitions,
# Line 1269  child_setup (in, out, err, new_argv, set Line 1287  child_setup (in, out, err, new_argv, set
1287    }    }
1288  #ifdef WINDOWSNT  #ifdef WINDOWSNT
1289    prepare_standard_handles (in, out, err, handles);    prepare_standard_handles (in, out, err, handles);
1290    set_process_dir (XSTRING (current_dir)->data);    set_process_dir (SDATA (current_dir));
1291  #else  /* not WINDOWSNT */  #else  /* not WINDOWSNT */
1292    /* Make sure that in, out, and err are not actually already in    /* Make sure that in, out, and err are not actually already in
1293       descriptors zero, one, or two; this could happen if Emacs is       descriptors zero, one, or two; this could happen if Emacs is
# Line 1394  getenv_internal (var, varlen, value, val Line 1412  getenv_internal (var, varlen, value, val
1412    
1413        entry = XCAR (scan);        entry = XCAR (scan);
1414        if (STRINGP (entry)        if (STRINGP (entry)
1415            && STRING_BYTES (XSTRING (entry)) > varlen            && SBYTES (entry) > varlen
1416            && XSTRING (entry)->data[varlen] == '='            && SREF (entry, varlen) == '='
1417  #ifdef WINDOWSNT  #ifdef WINDOWSNT
1418            /* NT environment variables are case insensitive.  */            /* NT environment variables are case insensitive.  */
1419            && ! strnicmp (XSTRING (entry)->data, var, varlen)            && ! strnicmp (SDATA (entry), var, varlen)
1420  #else  /* not WINDOWSNT */  #else  /* not WINDOWSNT */
1421            && ! bcmp (XSTRING (entry)->data, var, varlen)            && ! bcmp (SDATA (entry), var, varlen)
1422  #endif /* not WINDOWSNT */  #endif /* not WINDOWSNT */
1423            )            )
1424          {          {
1425            *value    = (char *) XSTRING (entry)->data + (varlen + 1);            *value    = (char *) SDATA (entry) + (varlen + 1);
1426            *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1);            *valuelen = SBYTES (entry) - (varlen + 1);
1427            return 1;            return 1;
1428          }          }
1429      }      }
# Line 1424  This function consults the variable ``pr Line 1442  This function consults the variable ``pr
1442    int valuelen;    int valuelen;
1443    
1444    CHECK_STRING (var);    CHECK_STRING (var);
1445    if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)),    if (getenv_internal (SDATA (var), SBYTES (var),
1446                         &value, &valuelen))                         &value, &valuelen))
1447      return make_string (value, valuelen);      return make_string (value, valuelen);
1448    else    else
# Line 1449  egetenv (var) Line 1467  egetenv (var)
1467  #endif /* not VMS */  #endif /* not VMS */
1468    
1469  /* This is run before init_cmdargs.  */  /* This is run before init_cmdargs.  */
1470      
1471  void  void
1472  init_callproc_1 ()  init_callproc_1 ()
1473  {  {
# Line 1457  init_callproc_1 () Line 1475  init_callproc_1 ()
1475    char *doc_dir = egetenv ("EMACSDOC");    char *doc_dir = egetenv ("EMACSDOC");
1476    
1477    Vdata_directory    Vdata_directory
1478      = Ffile_name_as_directory (build_string (data_dir ? data_dir      = Ffile_name_as_directory (build_string (data_dir ? data_dir
1479                                               : PATH_DATA));                                               : PATH_DATA));
1480    Vdoc_directory    Vdoc_directory
1481      = Ffile_name_as_directory (build_string (doc_dir ? doc_dir      = Ffile_name_as_directory (build_string (doc_dir ? doc_dir
# Line 1476  void Line 1494  void
1494  init_callproc ()  init_callproc ()
1495  {  {
1496    char *data_dir = egetenv ("EMACSDATA");    char *data_dir = egetenv ("EMACSDATA");
1497        
1498    register char * sh;    register char * sh;
1499    Lisp_Object tempdir;    Lisp_Object tempdir;
1500    
# Line 1494  init_callproc () Line 1512  init_callproc ()
1512            Vexec_path = Fcons (tem, Vexec_path);            Vexec_path = Fcons (tem, Vexec_path);
1513            Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);            Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
1514          }          }
1515          
1516        Vexec_directory = Ffile_name_as_directory (tem);        Vexec_directory = Ffile_name_as_directory (tem);
1517  #endif /* not DOS_NT */  #endif /* not DOS_NT */
1518    
# Line 1539  init_callproc () Line 1557  init_callproc ()
1557  #endif  #endif
1558      {      {
1559        tempdir = Fdirectory_file_name (Vexec_directory);        tempdir = Fdirectory_file_name (Vexec_directory);
1560        if (access (XSTRING (tempdir)->data, 0) < 0)        if (access (SDATA (tempdir), 0) < 0)
1561          dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n",          dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n",
1562                       Vexec_directory);                       Vexec_directory);
1563      }      }
1564    
1565    tempdir = Fdirectory_file_name (Vdata_directory);    tempdir = Fdirectory_file_name (Vdata_directory);
1566    if (access (XSTRING (tempdir)->data, 0) < 0)    if (access (SDATA (tempdir), 0) < 0)
1567      dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n",      dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n",
1568                   Vdata_directory);                   Vdata_directory);
1569    
# Line 1569  init_callproc () Line 1587  init_callproc ()
1587    else    else
1588      Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX");      Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX");
1589  #endif  #endif
1590    
1591    #ifdef DOS_NT
1592      Vshared_game_score_directory = Qnil;
1593    #else
1594      Vshared_game_score_directory = build_string (PATH_GAME);
1595      if (NILP (Ffile_directory_p (Vshared_game_score_directory)))
1596        Vshared_game_score_directory = Qnil;
1597    #endif
1598  }  }
1599    
1600  void  void
# Line 1629  includes this.  */); Line 1655  includes this.  */);
1655    DEFVAR_LISP ("shared-game-score-directory", &Vshared_game_score_directory,    DEFVAR_LISP ("shared-game-score-directory", &Vshared_game_score_directory,
1656                 doc: /* Directory of score files for games which come with GNU Emacs.                 doc: /* Directory of score files for games which come with GNU Emacs.
1657  If this variable is nil, then Emacs is unable to use a shared directory.  */);  If this variable is nil, then Emacs is unable to use a shared directory.  */);
1658  #ifdef HAVE_SHARED_GAME_DIR  #ifdef DOS_NT
   Vshared_game_score_directory = build_string(HAVE_SHARED_GAME_DIR);  
 #else  
1659    Vshared_game_score_directory = Qnil;    Vshared_game_score_directory = Qnil;
1660    #else
1661      Vshared_game_score_directory = build_string (PATH_GAME);
1662  #endif  #endif
1663    
1664    DEFVAR_LISP ("temp-file-name-pattern", &Vtemp_file_name_pattern,    DEFVAR_LISP ("temp-file-name-pattern", &Vtemp_file_name_pattern,

Legend:
Removed from v.1.187  
changed lines
  Added in v.1.187.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26