Skip to content

Commit f4509d5

Browse files
committed
newlisp -x: Set produced object file as executable
1 parent 9eb8f27 commit f4509d5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

newlisp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,14 @@ for(idx = 1; idx < argc; idx++)
886886

887887
if(strncmp(argv[idx], "-x", 2) == 0)
888888
{
889-
if(argc == 4)
889+
if(argc == 4) {
890890
linkSource(argv[0], argv[idx + 1], argv[idx + 2]);
891-
exit(0);
891+
if (chmod(argv[idx + 2], 0755) != 0)
892+
fatalError(ERR_IO_ERROR, 0, 0);
893+
exit(0);
894+
}
895+
varPrintf(OUT_CONSOLE, "correct usage: %s -x source.lsp a.out\n", argv[0]);
896+
exit(1);
892897
}
893898

894899
if(strcmp(argv[idx], "-h") == 0)

0 commit comments

Comments
 (0)