patch-2.3.47 linux/fs/binfmt_script.c

Next file: linux/fs/buffer.c
Previous file: linux/fs/attr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/fs/binfmt_script.c linux/fs/binfmt_script.c
@@ -14,7 +14,7 @@
 
 static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
 {
-	char *cp, *i_name, *i_name_start, *i_arg;
+	char *cp, *i_name, *i_arg;
 	struct dentry * dentry;
 	char interp[128];
 	int retval;
@@ -44,17 +44,15 @@
 	for (cp = bprm->buf+2; (*cp == ' ') || (*cp == '\t'); cp++);
 	if (*cp == '\0') 
 		return -ENOEXEC; /* No interpreter name found */
-	i_name_start = i_name = cp;
+	i_name = cp;
 	i_arg = 0;
-	for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++) {
- 		if (*cp == '/')
-			i_name = cp+1;
-	}
+	for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
+		/* nothing */ ;
 	while ((*cp == ' ') || (*cp == '\t'))
 		*cp++ = '\0';
 	if (*cp)
 		i_arg = cp;
-	strcpy (interp, i_name_start);
+	strcpy (interp, i_name);
 	/*
 	 * OK, we've parsed out the interpreter name and
 	 * (optional) argument.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)