【 以下文字转载自 atppp 的信箱 】
发信人: atppp (Big Mouse), 信区: cnBBSDev
标 题: [smthbbs] 英文长行自动词间断行 - 测试
发信站: 牧场物语 (Wed May 5 17:24:47 2004), 转信
这个功能是不是以前有的后来去掉了?反正我就胡加一下,没有什么时间大量测试,
希望有兴趣的朋友帮我测试一下反馈错误。
src/more.c
@@ -432,8 +432,13 @@ int measure_line(char *p0, int size, int
if (!db) {
if(autoline)
if ((w >= scr_cols-1&&(i>=size-1||*(p+1)<0) )|| w >= scr_cols) {
- *l = i;
- *s = i;
+ if (((unsigned char)*p<128) && (lastspace>0) && (lastspace<i)) {
+ *l = lastspace+1;
+ *s = lastspace+1;
+ } else {
+ *l = i;
+ *s = i;
+ }
break;
}
if ((unsigned char) *p >= 128)
80列终端下效果:
老代码:
A variant of the Gaobot worm appeared at Yale over the weekend. This worm strong
ly resembles the W32.Gaobot.UM strain, but there are differences in the filename
s. It spreads through administrative shares with weak passwords, and can affect
W2000 and Windows XP machines that are fully patched and have up-to-date NAV def
initions.
新代码:
A variant of the Gaobot worm appeared at Yale over the weekend. This worm
strongly resembles the W32.Gaobot.UM strain, but there are differences in the
filenames. It spreads through administrative shares with weak passwords, and
can affect W2000 and Windows XP machines that are fully patched and have
up-to-date NAV definitions.
YTHT上:
A variant of the Gaobot worm appeared at Yale over the weekend. This worm
strongly resembles the W32.Gaobot.UM strain, but there are differences in the
filenames. It spreads through administrative shares with weak passwords, and can
affect W2000 and Windows XP machines that are fully patched and have up-to-date
NAV definitions.
--