8000 Merge pull request #2 from freebsd/master · freebsd/freebsd-src@b02e7bf · GitHub
[go: up one dir, main page]

Skip to content

Commit b02e7bf

Browse files
committed
Merge pull request #2 from freebsd/master
1103
2 parents b8f157a + eef7043 commit b02e7bf

File tree

32 files changed

+155
-166
lines changed

32 files changed

+155
-166
lines changed

ObsoleteFiles.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
# xargs -n1 | sort | uniq -d;
3939
# done
4040

41+
# 20131103: WITH_LIBICONV_COMPAT removal
42+
OLD_FILES+=usr/include/_libiconv_compat.h
43+
OLD_FILES+=usr/lib/libiconv.a
44+
OLD_FILES+=usr/lib/libiconv.so
45+
OLD_FILES+=usr/lib/libiconv.so.3
46+
OLD_FILES+=usr/lib/libiconv_p.a
47+
# 20131103: removal of utxrm(8), use 'utx rm' instead.
48+
OLD_FILES+=usr/sbin/utxrm
49+
OLD_FILES+=usr/share/man/man8/utxrm.8.gz
4150
# 20131031: pkg_install has been removed
4251
OLD_FILES+=etc/periodic/daily/220.backup-pkgdb
4352
OLD_FILES+=etc/periodic/daily/490.status-pkg-changes

cddl/lib/libnvpair/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@ CFLAGS+= -I${.CURDIR}/../../../sys
2121
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
2222
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
2323

24+
# This library uses macros to define fprintf behvavior for several object types
25+
# The compiler will see the non-string literal arguments to the fprintf calls and
26+
# omit warnings for them. Quiese these warnings in contrib code:
27+
#
28+
# cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format
29+
# string is not a string literal (potentially insecure) [-Wformat-security]
30+
# ARENDER(pctl, nvlist_array, nvl, name, val, nelem);
31+
#
32+
CFLAGS+= -Wno-format-security
2433
.include <bsd.lib.mk>

contrib/libreadline/display.c

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,14 @@ rl_expand_prompt (prompt)
392392
t = ++p;
393393
local_prompt = expand_prompt (p, &prompt_visible_length,
394394
&prompt_last_invisible,
395-
(int *)NULL,
395+
&prompt_invis_chars_first_line,
396396
&prompt_physical_chars);
397397
c = *t; *t = '\0';
398398
/* The portion of the prompt string up to and including the
399399
final newline is now null-terminated. */
400400
local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
401401
(int *)NULL,
402-
&prompt_invis_chars_first_line,
402+
(int *)NULL,
403403
(int *)NULL);
404404
*t = c;
405405
local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
@@ -911,6 +911,10 @@ rl_redisplay ()
911911
second and subsequent lines start at inv_lbreaks[N], offset by
912912
OFFSET (which has already been calculated above). */
913913

914+
#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
915+
#define WRAP_OFFSET(line, offset) ((line == 0) \
916+
? (offset ? INVIS_FIRST() : 0) \
917+
: ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
914918
#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
915919
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
916920
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
@@ -945,7 +949,13 @@ rl_redisplay ()
945949
_rl_last_c_pos != o_cpos &&
946950
_rl_last_c_pos > wrap_offset &&
947951
o_cpos < prompt_last_invisible)
948-
_rl_last_c_pos -= wrap_offset;
952+
_rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */
953+
else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth &&
954+
(MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
955+
cpos_adjusted == 0 &&
956+
_rl_last_c_pos != o_cpos &&
957+
_rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line))
958+
_rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
949959

950960
/* If this is the line with the prompt, we might need to
951961
compensate for invisible characters in the new line. Do
@@ -1049,7 +1059,7 @@ rl_redisplay ()
10491059
tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
10501060
else
10511061
tx = nleft;
1052-
if (_rl_last_c_pos > tx)
1062+
if (tx >= 0 && _rl_last_c_pos > tx)
10531063
{
10541064
_rl_backspace (_rl_last_c_pos - tx); /* XXX */
10551065
_rl_last_c_pos = tx;
@@ -1205,7 +1215,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
12051215
int current_line, omax, nmax, inv_botlin;
12061216
{
12071217
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
1208-
int temp, lendiff, wsatend, od, nd;
1218+
int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
12091219
int current_invis_chars;
12101220
int col_lendiff, col_temp;
12111221
#if defined (HANDLE_MULTIBYTE)
@@ -1221,7 +1231,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
12211231
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
12221232
temp = _rl_last_c_pos;
12231233
else
1224-
temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
1234+
temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
12251235
if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
12261236
&& _rl_last_v_pos == current_line - 1)
12271237
{
@@ -1466,6 +1476,8 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
14661476
_rl_last_c_pos = lendiff;
14671477
}
14681478

1479+
o_cpos = _rl_last_c_pos;
1480+
14691481
/* When this function returns, _rl_last_c_pos is correct, and an absolute
14701482
cursor postion in multibyte mode, but a buffer index when not in a
14711483
multibyte locale. */
@@ -1475,7 +1487,9 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
14751487
/* We need to indicate that the cursor position is correct in the presence of
14761488
invisible characters in the prompt string. Let's see if setting this when
14771489
we make sure we're at the end of the drawn prompt string works. */
1478-
if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
1490+
if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 &&
1491+
(_rl_last_c_pos > 0 || o_cpos > 0) &&
1492+
_rl_last_c_pos == prompt_physical_chars)
14791493
cpos_adjusted = 1;
14801494
#endif
14811495
#endif
@@ -1566,27 +1580,32 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
15661580
}
15671581
else
15681582
{
1569-
/* We have horizontal scrolling and we are not inserting at
1570-
the end. We have invisible characters in this line. This
1571-
is a dumb update. */
15721583
_rl_output_some_chars (nfd, temp);
15731584
_rl_last_c_pos += col_temp;
1585+
/* If nfd begins before any invisible characters in the prompt,
1586+
adjust _rl_last_c_pos to account for wrap_offset and set
1587+
cpos_adjusted to let the caller know. */
1588+
if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
1589+
{
1590+
_rl_last_c_pos -= wrap_offset;
1591+
cpos_adjusted = 1;
1592+
}
15741593
return;
15751594
}
15761595
/* Copy (new) chars to screen from first diff to last match. */
15771596
temp = nls - nfd;
15781597
if ((temp - lendiff) > 0)
15791598
{
15801599
_rl_output_some_chars (nfd + lendiff, temp - lendiff);
1581-
#if 1
15821600
/* XXX -- this bears closer inspection. Fixes a redisplay bug
15831601
reported against bash-3.0-alpha by Andreas Schwab involving
15841602
multibyte characters and prompt strings with invisible
15851603
characters, but was previously disabled. */
1586-
_rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
1587-
#else
1588-
_rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
1589-
#endif
1604+
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
1605+
twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
1606+
else
1607+
twidth = temp - lendiff;
1608+
_rl_last_c_pos += twidth;
15901609
}
15911610
}
15921611
else
@@ -1780,7 +1799,7 @@ _rl_move_cursor_relative (new, data)
17801799
int woff; /* number of invisible chars on current line */
17811800
int cpos, dpos; /* current and desired cursor positions */
17821801

1783-
woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
1802+
woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
17841803
cpos = _rl_last_c_pos;
17851804
#if defined (HANDLE_MULTIBYTE)
17861805
/* If we have multibyte characters, NEW is indexed by the buffer point in
@@ -1794,7 +1813,11 @@ _rl_move_cursor_relative (new, data)
17941813
/* Use NEW when comparing against the last invisible character in the
17951814
prompt string, since they're both buffer indices and DPOS is a
17961815
desired display position. */
1797-
if (new > prompt_last_invisible) /* XXX - don't use woff here */
1816+
if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
1817+
(prompt_physical_chars > _rl_screenwidth &&
1818+
_rl_last_v_pos == prompt_last_screen_line &&
1819+
wrap_offset != woff &&
1820+
new > (prompt_last_invisible-_rl_screenwidth-wrap_offset)))
17981821
{
17991822
dpos -= woff;
18001823
/* Since this will be assigned to _rl_last_c_pos at the end (more

contrib/libreadline/input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ _rl_unget_char (key)
154154
{
155155
pop_index--;
156156
if (pop_index < 0)
157-
pop_index = ibuffer_len - 1;
157+
pop_index = ibuffer_len;
158158
ibuffer[pop_index] = key;
159159
return (1);
160160
}

contrib/libreadline/support/shobj-conf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Chet Ramey
1111
# chet@po.cwru.edu
1212

13-
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
13+
# Copyright (C) 1996-2007 Free Software Foundation, Inc.
1414
#
1515
# This program is free software; you can redistribute it and/or modify
1616
# it under the terms of the GNU General Public License as published by
@@ -114,7 +114,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
114114
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
115115
;;
116116

117-
freebsd2* | netbsd*)
117+
freebsd2*)
118118
SHOBJ_CFLAGS=-fpic
119119
SHOBJ_LD=ld
120120
SHOBJ_LDFLAGS='-x -Bshareable'
@@ -125,7 +125,7 @@ freebsd2* | netbsd*)
125125

126126
# FreeBSD-3.x ELF
127127
freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
128-
SHOBJ_CFLAGS=-fpic
128+
SHOBJ_CFLAGS=-fPIC
129129
SHOBJ_LD='${CC}'
130130

131131
if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
@@ -142,7 +142,7 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
142142
;;
143143

144144
# Darwin/MacOS X
145-
darwin8*)
145+
darwin[89]*)
146146
SHOBJ_STATUS=supported
147147
SHLIB_STATUS=supported
148148

@@ -153,7 +153,7 @@ darwin8*)
153153
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
154154
SHLIB_LIBSUFF='dylib'
155155

156-
SHOBJ_LDFLAGS='-undefined dynamic_lookup'
156+
SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
157157
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
158158

159159
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
@@ -171,7 +171,7 @@ darwin*|macosx*)
171171
SHLIB_LIBSUFF='dylib'
172172

173173
case "${host_os}" in
174-
darwin[78]*) SHOBJ_LDFLAGS=''
174+
darwin[789]*) SHOBJ_LDFLAGS=''
175175
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
176176
;;
177177
*) SHOBJ_LDFLAGS='-dynamic'
@@ -182,7 +182,7 @@ darwin*|macosx*)
182182
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
183183
;;
184184

185-
openbsd*)
185+
openbsd*|netbsd*)
186186
SHOBJ_CFLAGS=-fPIC
187187
SHOBJ_LD='${CC}'
188188
SHOBJ_LDFLAGS='-shared'
@@ -247,7 +247,7 @@ osf*)
247247
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
248248
;;
249249

250-
aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
250+
aix4.[2-9]*-*gcc*|aix[5-9].*-*gcc*) # lightly tested by jik@cisco.com
251251
SHOBJ_CFLAGS=-fpic
252252
SHOBJ_LD='ld'
253253
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
@@ -258,7 +258,7 @@ aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
258258
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
259259
;;
260260

261-
aix4.[2-9]*)
261+
aix4.[2-9]*|aix[5-9].*)
262262
SHOBJ_CFLAGS=-K
263263
SHOBJ_LD='ld'
264264
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
@@ -329,7 +329,7 @@ hpux10*-*gcc*)
329329
SHOBJ_LD='${CC}'
330330
# if you have problems linking here, moving the `-Wl,+h,$@' from
331331
# SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
332-
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
332+
SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
333333

334334
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
335335
SHLIB_LIBSUFF='sl'

include/Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,7 @@ _netipx= netipx
8383

8484
# Handle the #define aliases for libiconv
8585
.if ${MK_ICONV} == "yes"
86-
CLEANFILES+= _libiconv_compat.h
87-
INCS+= _libiconv_compat.h iconv.h
88-
_libiconv_compat.h: ${.CURDIR}/Makefile
89-
echo "/* Indicate whether libiconv symbols are present */" > _libiconv_compat.h
90-
.if ${MK_LIBICONV_COMPAT} == "yes"
91-
echo "#define __LIBICONV_COMPAT" >> _libiconv_compat.h
92-
.else
93-
echo "#undef __LIBICONV_COMPAT" >> _libiconv_compat.h
94-
.endif
86+
INCS+= iconv.h
9587
.endif
9688

9789

include/iconv.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@
4040
#include <sys/cdefs.h>
4141
#include <sys/types.h>
4242

43-
#include <_libiconv_compat.h>
44-
#ifdef __LIBICONV_COMPAT
45-
#define libiconv_open iconv_open
46-
#define libiconv_close iconv_close
47-
#define libiconv iconv
48-
#define libiconv_t iconv_t
49-
#endif
5043
#ifdef __cplusplus
5144
typedef bool __iconv_bool;
5245
#elif __STDC_VERSION__ >= 199901L
@@ -76,22 +69,10 @@ size_t __iconv(iconv_t, const char **, size_t *, char **,
7669
/*
7770
* GNU interfaces for iconv
7871
*/
79-
#ifdef __LIBICONV_COMPAT
80-
#define libiconv_open_into iconv_open_into
81-
#define libiconvctl iconvctl
82-
#define libiconvlist iconvlist
83-
#define libiconv_set_relocation_prefix iconv_set_relocation_prefix
84-
#endif
85-
8672
/* We have iconvctl() */
8773
#define _ICONV_VERSION 0x0108
8874
extern int _iconv_version;
8975

90-
#ifdef __LIBICONV_COMPAT
91-
#define _libiconv_version _iconv_version
92-
#define _LIBICONV_VERSION _ICONV_VERSION
93-
#endif
94-
9576
typedef struct {
9677
void *spaceholder[64];
9778
} iconv_allocation_t;

lib/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ SUBDIR= ${SUBDIR_ORDERED} \
8181
${_libgpib} \
8282
${_libgssapi} \
8383
${_librpcsec_gss} \
84-
${_libiconv_compat} \
8584
libipsec \
8685
${_libipx} \
8786
libjail \
@@ -188,10 +187,6 @@ _libcxxrt= libcxxrt
188187
_libcplusplus= libc++
189188
.endif
190189

191-
.if ${MK_LIBICONV_COMPAT} != "no"
192-
_libiconv_compat= libiconv_compat
193-
.endif
194-
195190
.if ${MK_LIBTHR} != "no"
196191
_libthr= libthr
197192
.endif

lib/libc/iconv/Symbol.map

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ FBSD_1.2 {
66
__iconv;
77
__iconv_free_list;
88
__iconv_get_list;
9-
_libiconv_version;
109
iconv_canonicalize;
11-
libiconv;
12-
libiconv_close;
13-
libiconv_open;
14-
libiconv_open_into;
15-
libiconv_set_relocation_prefix;
16-
libiconvctl;
17-
libiconvlist;
1810
};
1911

2012
FBSD_1.3 {

lib/libc/iconv/iconv.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@
4747
#include "citrus_hash.h"
4848
#include "citrus_iconv.h"
4949

50-
#include <_libiconv_compat.h>
51-
#ifdef __LIBICONV_COMPAT
52-
__weak_reference(iconv, libiconv);
53-
__weak_reference(iconv_open, libiconv_open);
54-
__weak_reference(iconv_open_into, libiconv_open_into);
55-
__weak_reference(iconv_close, libiconv_close);
56-
__weak_reference(iconvlist, libiconvlist);
57-
__weak_reference(iconvctl, libiconvctl);
58-
__weak_reference(iconv_set_relocation_prefix, libiconv_set_relocation_prefix);
59-
__weak_reference(_iconv_version, _libiconv_version);
60-
#endif
61-
6250
#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1)
6351

6452
int _iconv_version = _ICONV_VERSION;

0 commit comments

Comments
 (0)
0