commit e4c92ea182a4cd36df998329115670e8a0d10168
parent c94641f8084d6e3dcc8626e63adfdea3f606840a
Author: ukai <ukai>
Date: Sun, 23 Feb 2003 16:00:11 +0000
[w3m-dev 03772] Compilation error on Cygwin B20.1
* terms.c (term_title): use Sprintf() instead of snprintf()
* doc-jp/README.cygwin doc/README.cygwin: add note about B20.1
From: patakuti@t3.rim.or.jp
Diffstat:
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-24 patakuti@t3.rim.or.jp
+
+ * [w3m-dev 03772] Compilation error on Cygwin B20.1
+ * terms.c (term_title): use Sprintf() instead of snprintf()
+ * doc-jp/README.cygwin doc/README.cygwin: add note about B20.1
+
2003-02-21 WATANABE Katsuyuki <knabe@sannet.ne.jp>
* [w3m-dev 03765] Re: README.cygwin
diff --git a/doc-jp/README.cygwin b/doc-jp/README.cygwin
@@ -12,6 +12,8 @@ Cygwin
w3m-0.2 以降から cygwin 向けの修正パッチが取り込まれたため,cygwin-1.1.4
以降の環境であれば特に問題なくビルドできます.Net Release 前の B18, B19,
B20あたりでもビルドできるはずですが,確認はされていません.
+ (*) Cygwin B20.1 の環境では
+ LOCAL_LIBRARIES に -luser32 をつける必要があります。
なお,termcap ないし ncurses パッケージは最新のものを使ってください.特
に termcap を使う場合,古いパッケージは /etc/termcap の cygwin のエント
diff --git a/doc/README.cygwin b/doc/README.cygwin
@@ -11,6 +11,7 @@ Build
After w3m-0.2, patches for Cygwin have been marged to w3m packages. If you use
cygwin-1.1.4 or later, w3m shuould be build without any problems.
+ (*) on Cygwin B20.1, you should add -luser32 to LOCAL_LIBRARIES
The newest version of termcap and ncurses package are recomended. Especially,
older versions of termcap have bugs in the entry for Cygwin which make the
diff --git a/terms.c b/terms.c
@@ -1827,9 +1827,12 @@ term_title(char *s)
if (title_str != NULL) {
#ifdef __CYGWIN__
if (isLocalConsole && title_str == CYGWIN_TITLE) {
- char buff[1024];
- snprintf(buff, sizeof(buff), title_str, s);
- SetConsoleTitle(buff);
+ Str buff;
+ buff = Sprintf(title_str, s);
+ if (buff->length > 1024) {
+ Strtruncate(buff, 1024);
+ }
+ SetConsoleTitle(buff->ptr);
}
else if (isLocalConsole || !isWinConsole)
#endif