Re: BUG: no #! line in shell scripts created for menu commands
- From: "Andrew V. Samoilov" <andrew email zp ua>
- To: Rudolf Polzer <atfield-dt durchnull de>
- Cc: mc-devel gnome org
- Subject: Re: BUG: no #! line in shell scripts created for menu commands
- Date: Mon, 22 Dec 2003 14:06:28 +0200 (EET)
> I have lines like
>
> p add the files to playd (TEMP)
> playd put_end prepend %s
>
> in my menu file. Now I noticed I get a "cannot execute binary file"
> error message when the file name contains non-ASCII characters. Looking
> at the temporary file named in the error message, I saw that the #! line
> was missing. And really, adding a #!/bin/sh line worked:
>
> p add the files to playd (TEMP)
> #!/bin/sh
> playd put_end prepend %s
>
> So what I first thought was that I misread the documentation. But even the
> examples don't contain the shebang line. So I see two possible ways to fix
> this bug:
>
> a) document it and correct the examples
> b) add a "correct" shebang line (#!$SHELL? #!/bin/sh? User-defined setting?)
> in these temporary files
Patch attached.
--
Regards,
Andrew V. Samoilov.
--- src/user.c.bak Mon Dec 22 13:31:51 2003
+++ src/user.c Mon Dec 22 13:34:23 2003
@@ -563,6 +563,7 @@ execute_menu_command (WEdit *edit_widget
return;
}
cmd_file = fdopen (cmd_file_fd, "w");
+ fputs ("#! /bin/sh\n", cmd_file);
commands++;
for (col = 0; *commands; commands++){
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]