diff options
| author | Stefan Monnier | 2001-10-12 03:23:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-12 03:23:25 +0000 |
| commit | b81a1b72a82185bc426d31f914a5d3d7fee14c4e (patch) | |
| tree | c6f8387fcb7983bcd2b9d256dc386c4ca49d876c /src | |
| parent | 183d18335505777fe44514c86ea97efba2b0e3af (diff) | |
| download | emacs-b81a1b72a82185bc426d31f914a5d3d7fee14c4e.tar.gz emacs-b81a1b72a82185bc426d31f914a5d3d7fee14c4e.zip | |
(Vexec_suffixes): New var.
(Fcall_process): Update call to openp.
(decode_suffixes): New function.
(syms_of_callproc): Init exec-suffixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callproc.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c index fc4d0bf3379..37b52ac5a2a 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -103,9 +103,8 @@ extern char **environ; | |||
| 103 | #endif | 103 | #endif |
| 104 | #endif | 104 | #endif |
| 105 | 105 | ||
| 106 | #define max(a, b) ((a) > (b) ? (a) : (b)) | 106 | Lisp_Object Vexec_path, Vexec_directory, Vexec_suffixes; |
| 107 | 107 | Lisp_Object Vdata_directory, Vdoc_directory; | |
| 108 | Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory; | ||
| 109 | Lisp_Object Vconfigure_info_directory; | 108 | Lisp_Object Vconfigure_info_directory; |
| 110 | Lisp_Object Vtemp_file_name_pattern; | 109 | Lisp_Object Vtemp_file_name_pattern; |
| 111 | 110 | ||
| @@ -380,7 +379,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 380 | struct gcpro gcpro1; | 379 | struct gcpro gcpro1; |
| 381 | 380 | ||
| 382 | GCPRO1 (current_dir); | 381 | GCPRO1 (current_dir); |
| 383 | openp (Vexec_path, args[0], EXEC_SUFFIXES, &path, 1); | 382 | openp (Vexec_path, args[0], Vexec_suffixes, &path, 1); |
| 384 | UNGCPRO; | 383 | UNGCPRO; |
| 385 | } | 384 | } |
| 386 | if (NILP (path)) | 385 | if (NILP (path)) |
| @@ -1571,6 +1570,28 @@ set_process_environment () | |||
| 1571 | Vprocess_environment); | 1570 | Vprocess_environment); |
| 1572 | } | 1571 | } |
| 1573 | 1572 | ||
| 1573 | static Lisp_Object | ||
| 1574 | decode_suffixes (string) | ||
| 1575 | char *string; | ||
| 1576 | { | ||
| 1577 | char *p; | ||
| 1578 | Lisp_Object suffixes; | ||
| 1579 | |||
| 1580 | suffixes = Qnil; | ||
| 1581 | while (1) | ||
| 1582 | { | ||
| 1583 | p = index (string, ':'); | ||
| 1584 | if (!p) p = string + strlen (string); | ||
| 1585 | suffixes = Fcons (make_string (string, p - string), | ||
| 1586 | suffixes); | ||
| 1587 | if (*p) | ||
| 1588 | string = p + 1; | ||
| 1589 | else | ||
| 1590 | break; | ||
| 1591 | } | ||
| 1592 | return Fnreverse (suffixes); | ||
| 1593 | } | ||
| 1594 | |||
| 1574 | void | 1595 | void |
| 1575 | syms_of_callproc () | 1596 | syms_of_callproc () |
| 1576 | { | 1597 | { |
| @@ -1587,6 +1608,11 @@ Initialized from the SHELL environment variable."); | |||
| 1587 | "*List of directories to search programs to run in subprocesses.\n\ | 1608 | "*List of directories to search programs to run in subprocesses.\n\ |
| 1588 | Each element is a string (directory name) or nil (try default directory)."); | 1609 | Each element is a string (directory name) or nil (try default directory)."); |
| 1589 | 1610 | ||
| 1611 | DEFVAR_LISP ("exec-suffixes", &Vexec_suffixes, | ||
| 1612 | "*List of suffixes to try to find executable file names.\n\ | ||
| 1613 | Each element is a string"); | ||
| 1614 | Vexec_suffixes = decode_suffixes (EXEC_SUFFIXES); | ||
| 1615 | |||
| 1590 | DEFVAR_LISP ("exec-directory", &Vexec_directory, | 1616 | DEFVAR_LISP ("exec-directory", &Vexec_directory, |
| 1591 | "Directory for executables for Emacs to invoke.\n\ | 1617 | "Directory for executables for Emacs to invoke.\n\ |
| 1592 | More generally, this includes any architecture-dependent files\n\ | 1618 | More generally, this includes any architecture-dependent files\n\ |