Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 74694 | Differences between
and this patch

Collapse All | Expand All

(-)vilistextum-2.6.7/CHANGES (-2 / +7 lines)
Lines 1-9 Link Here
1
2.6.8-devel: (??.??.2005)
2
3
  - configure falls back to standard iconv() if no libiconv is found
4
  - BUGFIX: three off-by-one error in get_attr found by Ewald Dieterich
5
1
2.6.7: (19.12.2004)
6
2.6.7: (19.12.2004)
2
7
3
  - BUGFIX: buffer overflow in get_attr found by Ariel Berkman
8
  - BUGFIX: buffer overflow in get_attr() found by Ariel Berkman
4
  - BUGFIX: compilation fix for Solaris by Fredrik Roubert
9
  - BUGFIX: compilation fix for Solaris by Fredrik Roubert
5
  - more robust behaviour when encountering invalid byte sequences
10
  - more robust behaviour when encountering invalid byte sequences
6
  - added RPM-spec file by Joshua Jensen.
11
  - added RPM-spec file by Joshua Jensen
7
12
8
2.6.6: (24.08.2004)
13
2.6.6: (24.08.2004)
9
14
(-)vilistextum-2.6.7/config.h.in (+3 lines)
Lines 3-8 Link Here
3
/* Define to 1 if you have the <getopt.h> header file. */
3
/* Define to 1 if you have the <getopt.h> header file. */
4
#undef HAVE_GETOPT_H
4
#undef HAVE_GETOPT_H
5
5
6
/* Define to 1 if you have the <iconv.h> header file. */
7
#undef HAVE_ICONV_H
8
6
/* Define to 1 if you have the <inttypes.h> header file. */
9
/* Define to 1 if you have the <inttypes.h> header file. */
7
#undef HAVE_INTTYPES_H
10
#undef HAVE_INTTYPES_H
8
11
(-)vilistextum-2.6.7/configure (-5 / +151 lines)
Lines 1541-1547 Link Here
1541
1541
1542
# Define the identity of the package.
1542
# Define the identity of the package.
1543
 PACKAGE=vilistextum
1543
 PACKAGE=vilistextum
1544
 VERSION=2.6.7
1544
 VERSION=2.6.8-devel
1545
1545
1546
1546
1547
cat >>confdefs.h <<_ACEOF
1547
cat >>confdefs.h <<_ACEOF
Lines 1673-1679 Link Here
1673
1673
1674
1674
1675
cat >>confdefs.h <<_ACEOF
1675
cat >>confdefs.h <<_ACEOF
1676
#define RELEASEDATE "19.12.2004"
1676
#define RELEASEDATE "??.??.2005"
1677
_ACEOF
1677
_ACEOF
1678
1678
1679
1679
Lines 3631-3636 Link Here
3631
3631
3632
if test "$multibyte" = "yes"; then
3632
if test "$multibyte" = "yes"; then
3633
3633
3634
for ac_header in iconv.h
3635
do
3636
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3637
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3638
  echo "$as_me:$LINENO: checking for $ac_header" >&5
3639
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3640
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3641
  echo $ECHO_N "(cached) $ECHO_C" >&6
3642
fi
3643
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3644
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3645
else
3646
  # Is the header compilable?
3647
echo "$as_me:$LINENO: checking $ac_header usability" >&5
3648
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
3649
cat >conftest.$ac_ext <<_ACEOF
3650
#line $LINENO "configure"
3651
/* confdefs.h.  */
3652
_ACEOF
3653
cat confdefs.h >>conftest.$ac_ext
3654
cat >>conftest.$ac_ext <<_ACEOF
3655
/* end confdefs.h.  */
3656
$ac_includes_default
3657
#include <$ac_header>
3658
_ACEOF
3659
rm -f conftest.$ac_objext
3660
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3661
  (eval $ac_compile) 2>&5
3662
  ac_status=$?
3663
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3664
  (exit $ac_status); } &&
3665
         { ac_try='test -s conftest.$ac_objext'
3666
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3667
  (eval $ac_try) 2>&5
3668
  ac_status=$?
3669
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3670
  (exit $ac_status); }; }; then
3671
  ac_header_compiler=yes
3672
else
3673
  echo "$as_me: failed program was:" >&5
3674
sed 's/^/| /' conftest.$ac_ext >&5
3675
3676
ac_header_compiler=no
3677
fi
3678
rm -f conftest.$ac_objext conftest.$ac_ext
3679
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
3680
echo "${ECHO_T}$ac_header_compiler" >&6
3681
3682
# Is the header present?
3683
echo "$as_me:$LINENO: checking $ac_header presence" >&5
3684
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
3685
cat >conftest.$ac_ext <<_ACEOF
3686
#line $LINENO "configure"
3687
/* confdefs.h.  */
3688
_ACEOF
3689
cat confdefs.h >>conftest.$ac_ext
3690
cat >>conftest.$ac_ext <<_ACEOF
3691
/* end confdefs.h.  */
3692
#include <$ac_header>
3693
_ACEOF
3694
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
3695
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3696
  ac_status=$?
3697
  grep -v '^ *+' conftest.er1 >conftest.err
3698
  rm -f conftest.er1
3699
  cat conftest.err >&5
3700
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3701
  (exit $ac_status); } >/dev/null; then
3702
  if test -s conftest.err; then
3703
    ac_cpp_err=$ac_c_preproc_warn_flag
3704
  else
3705
    ac_cpp_err=
3706
  fi
3707
else
3708
  ac_cpp_err=yes
3709
fi
3710
if test -z "$ac_cpp_err"; then
3711
  ac_header_preproc=yes
3712
else
3713
  echo "$as_me: failed program was:" >&5
3714
sed 's/^/| /' conftest.$ac_ext >&5
3715
3716
  ac_header_preproc=no
3717
fi
3718
rm -f conftest.err conftest.$ac_ext
3719
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
3720
echo "${ECHO_T}$ac_header_preproc" >&6
3721
3722
# So?  What about this header?
3723
case $ac_header_compiler:$ac_header_preproc in
3724
  yes:no )
3725
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
3726
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
3727
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
3728
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
3729
    (
3730
      cat <<\_ASBOX
3731
## ------------------------------------ ##
3732
## Report this to bug-autoconf@gnu.org. ##
3733
## ------------------------------------ ##
3734
_ASBOX
3735
    ) |
3736
      sed "s/^/$as_me: WARNING:     /" >&2
3737
    ;;
3738
  no:yes )
3739
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
3740
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
3741
    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
3742
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
3743
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
3744
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
3745
    (
3746
      cat <<\_ASBOX
3747
## ------------------------------------ ##
3748
## Report this to bug-autoconf@gnu.org. ##
3749
## ------------------------------------ ##
3750
_ASBOX
3751
    ) |
3752
      sed "s/^/$as_me: WARNING:     /" >&2
3753
    ;;
3754
esac
3755
echo "$as_me:$LINENO: checking for $ac_header" >&5
3756
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3757
if eval "test \"\${$as_ac_Header+set}\" = set"; then
3758
  echo $ECHO_N "(cached) $ECHO_C" >&6
3759
else
3760
  eval "$as_ac_Header=$ac_header_preproc"
3761
fi
3762
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
3763
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3764
3765
fi
3766
if test `eval echo '${'$as_ac_Header'}'` = yes; then
3767
  cat >>confdefs.h <<_ACEOF
3768
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3769
_ACEOF
3770
3771
else
3772
  { { echo "$as_me:$LINENO: error: Need libiconv or iconv.h for multibyte support" >&5
3773
echo "$as_me: error: Need libiconv or iconv.h for multibyte support" >&2;}
3774
   { (exit 1); exit 1; }; }
3775
fi
3776
3777
done
3778
3779
3780
3634
echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
3781
echo "$as_me:$LINENO: checking for iconv in -liconv" >&5
3635
echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
3782
echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
3636
if test "${ac_cv_lib_iconv_iconv+set}" = set; then
3783
if test "${ac_cv_lib_iconv_iconv+set}" = set; then
Lines 3693-3701 Link Here
3693
  LIBS="-liconv $LIBS"
3840
  LIBS="-liconv $LIBS"
3694
3841
3695
else
3842
else
3696
  { { echo "$as_me:$LINENO: error: Need libiconv for multibyte support" >&5
3843
  { echo "$as_me:$LINENO: WARNING: only generic iconv has been found not libiconv" >&5
3697
echo "$as_me: error: Need libiconv for multibyte support" >&2;}
3844
echo "$as_me: WARNING: only generic iconv has been found not libiconv" >&2;}
3698
   { (exit 1); exit 1; }; }
3699
fi
3845
fi
3700
3846
3701
3847
(-)vilistextum-2.6.7/configure.in (-3 / +6 lines)
Lines 1-11 Link Here
1
dnl Process this file with autoconf to produce a configure script.
1
dnl Process this file with autoconf to produce a configure script.
2
AC_INIT(src/debug.h)
2
AC_INIT(src/debug.h)
3
AM_INIT_AUTOMAKE(vilistextum, 2.6.7)
3
AM_INIT_AUTOMAKE(vilistextum, 2.6.8-devel)
4
4
5
AM_CONFIG_HEADER(config.h)
5
AM_CONFIG_HEADER(config.h)
6
6
7
dnl Set current date
7
dnl Set current date
8
AC_DEFINE_UNQUOTED(RELEASEDATE, "19.12.2004", "Release date of the program")
8
AC_DEFINE_UNQUOTED(RELEASEDATE, "??.??.2005", "Release date of the program")
9
9
10
dnl Checks for programs.
10
dnl Checks for programs.
11
AC_PROG_CC
11
AC_PROG_CC
Lines 36-43 Link Here
36
36
37
dnl Checks for libraries.
37
dnl Checks for libraries.
38
if test "$multibyte" = "yes"; then
38
if test "$multibyte" = "yes"; then
39
AC_CHECK_HEADERS(iconv.h,,
40
			AC_MSG_ERROR(Need libiconv or iconv.h for multibyte support))
41
39
	AC_CHECK_LIB(iconv, iconv,,
42
	AC_CHECK_LIB(iconv, iconv,,
40
		AC_MSG_ERROR(Need libiconv for multibyte support))
43
			AC_MSG_WARN(only generic iconv has been found not libiconv))
41
44
42
dnl setting INTERNAL_LOCALE
45
dnl setting INTERNAL_LOCALE
43
AC_MSG_CHECKING(for unicode locale)
46
AC_MSG_CHECKING(for unicode locale)
(-)vilistextum-2.6.7/INSTALL (-1 / +1 lines)
Lines 11-17 Link Here
11
Multibyte/Unicode version
11
Multibyte/Unicode version
12
=========================
12
=========================
13
13
14
./configure --enable && make && make install
14
./configure --enable-multibyte && make && make install
15
15
16
The multibyte version needs libiconv.
16
The multibyte version needs libiconv.
17
http://www.gnu.org/software/libiconv
17
http://www.gnu.org/software/libiconv
(-)vilistextum-2.6.7/src/fileio.c (-10 / +15 lines)
Lines 27-37 Link Here
27
#ifdef MULTIBYTE
27
#ifdef MULTIBYTE
28
  #include <iconv.h>
28
  #include <iconv.h>
29
  #include <locale.h>
29
  #include <locale.h>
30
  #if defined(__sun__)
31
    #include <libcharset.h>
32
  #else
33
    #include <localcharset.h>
34
  #endif
35
#endif
30
#endif
36
31
37
FILE *in, *out;
32
FILE *in, *out;
Lines 74-105 Link Here
74
	char *inp, *outp;
69
	char *inp, *outp;
75
	int fehlernr=0;
70
	int fehlernr=0;
76
	size_t insize, outsize;
71
	size_t insize, outsize;
72
	char *ret;
77
73
78
	/* set locale based on environment variables */
74
	/* set locale based on environment variables */
79
	setlocale(LC_CTYPE, "");
75
	ret = setlocale(LC_CTYPE, "");
76
  if (ret==NULL) { 
77
		fprintf(stderr, "setlocale failed with: %s\n\n", getenv("LC_CTYPE"));
78
		exit(1);
79
	}
80
80
81
	insize = strlen(str);
81
	insize = strlen(str);
82
	if (insize > DEF_STR_LEN) { insize = DEF_STR_LEN; }
82
	outsize = DEF_STR_LEN;
83
	outsize = DEF_STR_LEN;
83
84
84
	inp = str;
85
	inp = str;
85
	outp = output;
86
	outp = output;
86
87
87
	if ((conv = iconv_open("utf-8", "char"))==(iconv_t)(-1))
88
	if ((conv = iconv_open("utf-8", "char"))==(iconv_t)(-1))
88
		{	printf("iconv_open failed in convert_string: Can't convert from %s to UTF-8?\n", locale_charset()); exit(1); }
89
		{	printf("iconv_open failed in convert_string: Can't convert from %s to UTF-8?\n", getenv("LC_CTYPE")); exit(1); }
89
90
90
	result = iconv(conv, &inp, &insize, &outp, &outsize);
91
	result = iconv(conv, &inp, &insize, &outp, &outsize);
91
	fehlernr = errno;
92
	fehlernr = errno;
92
93
93
	if (fehlernr==E2BIG) { fprintf(stderr, "errno==E2BIG\n"); }
94
	if (fehlernr==E2BIG) { fprintf(stderr, "errno==E2BIG\n"); }
94
	else if (fehlernr==EILSEQ) { 
95
	else if (fehlernr==EILSEQ) { 
95
		fprintf(stderr, "Can't convert '%s' as character set %s\n", str, locale_charset());
96
		fprintf(stderr, "Can't interpret '%s' as character from charset %s\n", str, getenv("LC_CTYPE"));
96
		fprintf(stderr, "Check your language settings with locale(1)\n");
97
		fprintf(stderr, "Check your language settings with locale(1)\n");
97
	}
98
	}
98
	else if (fehlernr==EINVAL) { fprintf(stderr, "errno==EINVAL\n"); }
99
	else if (fehlernr==EINVAL) { fprintf(stderr, "errno==EINVAL\n"); }
99
		
100
		
100
	output[strlen(output)] = '\0';
101
	output[strlen(output)] = '\0';
101
102
102
	setlocale(LC_CTYPE, INTERNAL_LOCALE);
103
	ret = setlocale(LC_CTYPE, INTERNAL_LOCALE);
104
  if (ret==NULL) { 
105
		fprintf(stderr, "setlocale failed with: %s\n\n", INTERNAL_LOCALE);
106
		exit(1);
107
	}
103
	mbstowcs(converted_string, output, strlen(output));
108
	mbstowcs(converted_string, output, strlen(output));
104
109
105
	iconv_close(conv);
110
	iconv_close(conv);
Lines 141-147 Link Here
141
		fehlernr = errno;
146
		fehlernr = errno;
142
147
143
		if (fehlernr==E2BIG) { fprintf(stderr, "errno==E2BIG\n"); }
148
		if (fehlernr==E2BIG) { fprintf(stderr, "errno==E2BIG\n"); }
144
		else if (fehlernr==EILSEQ) { fprintf(stderr, "errno==EILSEQ in output_string\n"); }
149
		else if (fehlernr==EILSEQ) { fprintf(stderr, "errno==EILSEQ in output_string\n"); fprintf(stderr, "input: %s\n", inp); }
145
		else if (fehlernr==EINVAL) { fprintf(stderr, "errno==EINVAL\n"); }
150
		else if (fehlernr==EINVAL) { fprintf(stderr, "errno==EINVAL\n"); }
146
		
151
		
147
		output[DEF_STR_LEN-outsize] = '\0';
152
		output[DEF_STR_LEN-outsize] = '\0';
(-)vilistextum-2.6.7/src/html.c (-10 / +7 lines)
Lines 95-103 Link Here
95
	while ((ch!='=') && (ch!='>')) {
95
	while ((ch!='=') && (ch!='>')) {
96
		ch=read_char();
96
		ch=read_char();
97
		if (i<DEF_STR_LEN) { attr_name[i++] = ch; }
97
		if (i<DEF_STR_LEN) { attr_name[i++] = ch; }
98
	}
98
	} /* post cond: i<=DEF_STR_LEN */
99
  if (i<DEF_STR_LEN) { attr_name[i-1] = '\0'; }
99
	attr_name[i-1] = '\0';
100
	else { attr_name[DEF_STR_LEN-1] = '\0'; }
101
	
100
	
102
  if (ch=='>') { attr_ctnt[0]='\0'; return '>'; }
101
  if (ch=='>') { attr_ctnt[0]='\0'; return '>'; }
103
102
Lines 116-126 Link Here
116
    i=0;
115
    i=0;
117
    ch=read_char();
116
    ch=read_char();
118
    while(quote!=ch) {
117
    while(quote!=ch) {
119
			if (i<DEF_STR_LEN) { temp[i++] = ch; }
118
			if (i<DEF_STR_LEN-1) { temp[i++] = ch; }
120
			ch=read_char(); 
119
			ch=read_char(); 
121
		}
120
		} /* post cond: i<=DEF_STR_LEN-1 */
122
		if (i<DEF_STR_LEN) { temp[i] = '\0'; }
121
		temp[i] = '\0';
123
    else { temp[DEF_STR_LEN] = '\0'; }
124
    ch=read_char();
122
    ch=read_char();
125
  }
123
  }
126
  else
124
  else
Lines 131-139 Link Here
131
    while ((ch!='>') && (!isspace(ch))) {
129
    while ((ch!='>') && (!isspace(ch))) {
132
			ch=read_char();
130
			ch=read_char();
133
			if (i<DEF_STR_LEN) { temp[i++] = ch; }
131
			if (i<DEF_STR_LEN) { temp[i++] = ch; }
134
		}
132
		} /* post cond: i<=DEF_STR_LEN */
135
		if (i<DEF_STR_LEN) { temp[i-1] = '\0'; }
133
		temp[i-1] = '\0';
136
    else { temp[DEF_STR_LEN-1] = '\0'; }
137
  }
134
  }
138
135
139
	uppercase_str(attr_name);
136
	uppercase_str(attr_name);
(-)vilistextum-2.6.7/src/html_tag.c (-5 / +5 lines)
Lines 52-63 Link Here
52
	/* read html tag */
52
	/* read html tag */
53
  while ((ch!='>') && (ch!=' ') && (ch!=13) && (ch!=10))
53
  while ((ch!='>') && (ch!=' ') && (ch!=13) && (ch!=10))
54
  {
54
  {
55
    if (i<DEF_STR_LEN) { str[i] = ch; }
55
    if (i<DEF_STR_LEN-1) { str[i++] = ch; }
56
		i++;
57
    ch = uppercase(read_char());
56
    ch = uppercase(read_char());
58
  }
57
  } /* post cond: i<=DEF_STR_LEN-1 */
59
	if (i>=DEF_STR_LEN) { str[DEF_STR_LEN] = '\0'; }
58
	str[i] = '\0';
60
	else { str[i] = '\0';}
61
59
62
#ifdef debug
60
#ifdef debug
63
  fprintf(stderr, "html_tag: %ls\n",str);
61
  fprintf(stderr, "html_tag: %ls\n",str);
Lines 332-337 Link Here
332
		else if CMP("/SCRIPT", str)   {}
330
		else if CMP("/SCRIPT", str)   {}
333
		else if CMP("STYLE", str)     {}
331
		else if CMP("STYLE", str)     {}
334
		else if CMP("/STYLE", str)    {}
332
		else if CMP("/STYLE", str)    {}
333
		else if CMP("TITLE", str)     {}
334
		else if CMP("/TITLE", str)    {}
335
		else { if (errorlevel>=2) { print_error("tag ignored: ", str);} } 
335
		else { if (errorlevel>=2) { print_error("tag ignored: ", str);} } 
336
	}
336
	}
337
337
(-)vilistextum-2.6.7/src/main.c (-1 / +1 lines)
Lines 253-259 Link Here
253
		case 's': 
253
		case 's': 
254
			shrink_lines = atoi(argument); if (shrink_lines==0) { shrink_lines = 1; } break;
254
			shrink_lines = atoi(argument); if (shrink_lines==0) { shrink_lines = 1; } break;
255
255
256
		case 'r': remove_empty_alt = 1; /* printf("remove_empty_alt\n"); */ break;
256
		case 'r': remove_empty_alt = 1; break;
257
		case 'i': 
257
		case 'i': 
258
#ifdef MULTIBYTE
258
#ifdef MULTIBYTE
259
			convert_string(argument, user_image);
259
			convert_string(argument, user_image);
(-)vilistextum-2.6.7/src/text.c (+4 lines)
Lines 249-258 Link Here
249
249
250
  if (!palm)
250
  if (!palm)
251
  {
251
  {
252
		if (wort_pos+len<DEF_STR_LEN) {
252
    while (i<wort_pos+len) { wort[i] = s[j]; j++; i++; }
253
    while (i<wort_pos+len) { wort[i] = s[j]; j++; i++; }
253
    wort[i] = '\0';
254
    wort[i] = '\0';
254
    wort_pos += len;
255
    wort_pos += len;
255
  }
256
  }
257
  }
256
258
257
#ifdef proc_debug
259
#ifdef proc_debug
258
  printf("wort_plus_string_nocount() ende\n");
260
  printf("wort_plus_string_nocount() ende\n");
Lines 273-281 Link Here
273
  printf("s: %ls len: %d\n", s,len);
275
  printf("s: %ls len: %d\n", s,len);
274
#endif
276
#endif
275
277
278
	if (wort_pos+len<DEF_STR_LEN) {
276
  while (i<wort_pos+len) { wort[i] = s[j]; j++; i++; }
279
  while (i<wort_pos+len) { wort[i] = s[j]; j++; i++; }
277
  wort[i] = '\0';
280
  wort[i] = '\0';
278
  wort_pos += len; wort_len += len;
281
  wort_pos += len; wort_len += len;
282
	}
279
283
280
#ifdef proc_debug
284
#ifdef proc_debug
281
  printf("wort_plus_string() ende\n");
285
  printf("wort_plus_string() ende\n");

Return to bug 74694