Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 301116
Collapse All | Expand All

(-)configure.in (-1 / +2 lines)
Lines 64-70 Link Here
64
AC_HEADER_STAT
64
AC_HEADER_STAT
65
AC_HEADER_TIME
65
AC_HEADER_TIME
66
AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
66
AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
67
		 memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h)
67
		 memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
68
		 sys/user.h linux/binfmts.h)
68
# Set a flag if we have an ANSI C compiler
69
# Set a flag if we have an ANSI C compiler
69
if test "$ac_cv_prog_cc_stdc" != no; then
70
if test "$ac_cv_prog_cc_stdc" != no; then
(-)job.c.orig (-1 / +48 lines)
Lines 29-34 Link Here
29
29
30
#include <string.h>
30
#include <string.h>
31
31
32
#if defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H)
33
#include <sys/user.h>
34
#include <linux/binfmts.h>
35
#endif
36
32
/* Default shell to use.  */
37
/* Default shell to use.  */
33
#ifdef WINDOWS32
38
#ifdef WINDOWS32
34
#include <windows.h>
39
#include <windows.h>
Lines 2697-2705 Link Here
2697
#endif
2702
#endif
2698
    unsigned int line_len = strlen (line);
2703
    unsigned int line_len = strlen (line);
2699
2704
2705
#ifdef MAX_ARG_STRLEN
2706
    static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ ";
2707
#define ARG_NUMBER_DIGITS 5
2708
#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \
2709
                 + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2))
2710
#else
2711
#define EVAL_LEN 0
2712
#endif
2700
    char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
2713
    char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
2701
				      + (line_len * 2) + 1);
2714
				      + (line_len*2) + 1 + EVAL_LEN);
2715
2702
    char *command_ptr = NULL; /* used for batch_mode_shell mode */
2716
    char *command_ptr = NULL; /* used for batch_mode_shell mode */
2717
    char *args_ptr;
2703
2718
2704
# ifdef __EMX__ /* is this necessary? */
2719
# ifdef __EMX__ /* is this necessary? */
2705
    if (!unixy_shell)
2720
    if (!unixy_shell)
Lines 2712-2717 Link Here
2712
    bcopy (minus_c, ap, sizeof (minus_c) - 1);
2727
    bcopy (minus_c, ap, sizeof (minus_c) - 1);
2713
    ap += sizeof (minus_c) - 1;
2728
    ap += sizeof (minus_c) - 1;
2714
    command_ptr = ap;
2729
    command_ptr = ap;
2730
2731
#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
2732
    if (unixy_shell && line_len > MAX_ARG_STRLEN)
2733
      {
2734
	unsigned j;
2735
	memcpy (ap, eval_line, sizeof (eval_line) - 1);
2736
	ap += sizeof (eval_line) - 1;
2737
	for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++)
2738
	  ap += sprintf (ap, "\\$\\{%u\\}", j);
2739
	*ap++ = '\\';
2740
	*ap++ = '"';
2741
	*ap++ = ' ';
2742
	/* Copy only the first word of SHELL to $0.  */
2743
	for (p = shell; *p != '\0'; ++p)
2744
	  {
2745
	    if (isspace ((unsigned char)*p))
2746
	      break;
2747
	    *ap++ = *p;
2748
	  }
2749
	*ap++ = ' ';
2750
      }
2751
#endif
2752
    args_ptr = ap;
2753
2715
    for (p = line; *p != '\0'; ++p)
2754
    for (p = line; *p != '\0'; ++p)
2716
      {
2755
      {
2717
	if (restp != NULL && *p == '\n')
2756
	if (restp != NULL && *p == '\n')
Lines 2760-2765 Link Here
2760
          }
2799
          }
2761
#endif
2800
#endif
2762
	*ap++ = *p;
2801
	*ap++ = *p;
2802
2803
#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
2804
	if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2))
2805
	  {
2806
	    *ap++ = ' ';
2807
	    args_ptr = ap;
2808
	  }
2809
#endif
2763
      }
2810
      }
2764
    if (ap == new_line + shell_len + sizeof (minus_c) - 1)
2811
    if (ap == new_line + shell_len + sizeof (minus_c) - 1)
2765
      /* Line was empty.  */
2812
      /* Line was empty.  */

Return to bug 301116