Mercurial > emacs
comparison src/process.c @ 47020:de9a20871faa
(Fstart_process): Remove /: from program name.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 24 Aug 2002 03:16:03 +0000 |
| parents | db28853d1e82 |
| children | 8871e67384e4 |
comparison
equal
deleted
inserted
replaced
| 47019:8ec5fd232f26 | 47020:de9a20871faa |
|---|---|
| 1419 /* Need to add code here to check for program existence on VMS */ | 1419 /* Need to add code here to check for program existence on VMS */ |
| 1420 | 1420 |
| 1421 #else /* not VMS */ | 1421 #else /* not VMS */ |
| 1422 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); | 1422 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); |
| 1423 | 1423 |
| 1424 /* If program file name is not absolute, search our path for it */ | 1424 /* If program file name is not absolute, search our path for it. |
| 1425 Put the name we will really use in TEM. */ | |
| 1425 if (!IS_DIRECTORY_SEP (SREF (program, 0)) | 1426 if (!IS_DIRECTORY_SEP (SREF (program, 0)) |
| 1426 && !(SCHARS (program) > 1 | 1427 && !(SCHARS (program) > 1 |
| 1427 && IS_DEVICE_SEP (SREF (program, 1)))) | 1428 && IS_DEVICE_SEP (SREF (program, 1)))) |
| 1428 { | 1429 { |
| 1429 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 1430 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 1433 openp (Vexec_path, program, Vexec_suffixes, &tem, make_number (X_OK)); | 1434 openp (Vexec_path, program, Vexec_suffixes, &tem, make_number (X_OK)); |
| 1434 UNGCPRO; | 1435 UNGCPRO; |
| 1435 if (NILP (tem)) | 1436 if (NILP (tem)) |
| 1436 report_file_error ("Searching for program", Fcons (program, Qnil)); | 1437 report_file_error ("Searching for program", Fcons (program, Qnil)); |
| 1437 tem = Fexpand_file_name (tem, Qnil); | 1438 tem = Fexpand_file_name (tem, Qnil); |
| 1438 tem = ENCODE_FILE (tem); | |
| 1439 new_argv[0] = SDATA (tem); | |
| 1440 } | 1439 } |
| 1441 else | 1440 else |
| 1442 { | 1441 { |
| 1443 if (!NILP (Ffile_directory_p (program))) | 1442 if (!NILP (Ffile_directory_p (program))) |
| 1444 error ("Specified program for new process is a directory"); | 1443 error ("Specified program for new process is a directory"); |
| 1445 | 1444 tem = program; |
| 1446 tem = ENCODE_FILE (program); | 1445 } |
| 1447 new_argv[0] = SDATA (tem); | 1446 |
| 1448 } | 1447 /* If program file name starts with /: for quoting a magic name, |
| 1448 discard that. */ | |
| 1449 if (SBYTES (tem) > 2 && SREF (tem, 0) == '/' | |
| 1450 && SREF (tem, 1) == ':') | |
| 1451 tem = Fsubstring (tem, make_number (2), Qnil); | |
| 1452 | |
| 1453 /* Encode the file name and put it in NEW_ARGV. | |
| 1454 That's where the child will use it to execute the program. */ | |
| 1455 tem = ENCODE_FILE (tem); | |
| 1456 new_argv[0] = SDATA (tem); | |
| 1449 | 1457 |
| 1450 /* Here we encode arguments by the coding system used for sending | 1458 /* Here we encode arguments by the coding system used for sending |
| 1451 data to the process. We don't support using different coding | 1459 data to the process. We don't support using different coding |
| 1452 systems for encoding arguments and for encoding data sent to the | 1460 systems for encoding arguments and for encoding data sent to the |
| 1453 process. */ | 1461 process. */ |
