From: drh <> Date: Sat, 11 Apr 2026 11:24:09 +0000 (+0000) Subject: Fix the \B escape for prompts so that it uses wcwidth() instead of X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=c8b130f2550155b07174765be33ba7c52ec6bef3;p=thirdparty%2Fsqlite.git Fix the \B escape for prompts so that it uses wcwidth() instead of strlen() to compute spacing. FossilOrigin-Name: c6ff4f701d9cf963cf2472ed72ad4e201227560dde2ba8d48602af2e49170e89 --- diff --git a/manifest b/manifest index fd9c7473a9..d19732cd62 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Ensure\sthat\ssqlite3-opfs-async-proxy.js\sis\scopied\sinto\sthe\sfiddle\starget\sdirs. -D 2026-04-10T23:25:57.996 +C Fix\sthe\s\B\sescape\sfor\sprompts\sso\sthat\sit\suses\swcwidth()\sinstead\sof\nstrlen()\sto\scompute\sspacing. +D 2026-04-11T11:24:09.462 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -735,7 +735,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 928ff887f2a7c64275182060d94d06fdddbe32226c569781cf7e7edc6f58d7fd F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c ffe199f025a0dd74670d2a77232bdea364a4d7b36f32c64a6572d39ba6a11576 -F src/shell.c.in 793a37b4db7a4e3c56ad997b2ff8b3210ab9954c7ea857558fa6ae3bb8750ccf +F src/shell.c.in 50505cdfdae8163b7c7476c7ad94c79c3b851274301e680dbb7b91c6d6bdc13b F src/sqlite.h.in a5605faa9479bbaac16c4ab43eb09ff50632004a8e05084d3fde56063ef73766 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479 F src/sqlite3ext.h 1b7a0ee438bb5c2896d0609c537e917d8057b3340f6ad004d2de44f03e3d3cca @@ -2197,8 +2197,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 3b17500dc6338df23d1ed0572cd71593da5a9b048731f73242e27b9a76553a27 -R 476d91cbd2e583bce4c47c269d3e9c58 -U stephan -Z 2eee38e661f38d66a6834d873120875b +P 7c9998de1b839cfbe12c4328ac5176f5fae981e139c5f8888b100752f5e4756b +R effaffd5b612cee5e2c7467276ff636f +U drh +Z 38f50b0294cde0ae9e16e79e3a672fcb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d406694df1..723703ae42 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7c9998de1b839cfbe12c4328ac5176f5fae981e139c5f8888b100752f5e4756b +c6ff4f701d9cf963cf2472ed72ad4e201227560dde2ba8d48602af2e49170e89 diff --git a/src/shell.c.in b/src/shell.c.in index 1d6af32b67..4e5f913c6c 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -1100,12 +1100,13 @@ static char *expand_prompt( /* Expand the \B, if there is one and if this is a continuation prompt */ if( idxSpace>=0 && zPrior!=0 && zPrior[0]!=0 ){ char *zOther = expand_prompt(p, 0, p->mainPrompt); - int nOther = strlen30(zOther); + size_t wOther = sqlite3_qrf_wcswidth(zOther); + size_t wThis = sqlite3_qrf_wcswidth(sqlite3_str_value(pOut)); sqlite3_free(zOther); - if( nOther>sqlite3_str_length(pOut) ){ + if( wOther>wThis ){ char *z; - int nNew = nOther - sqlite3_str_length(pOut); int len; + size_t nNew = wOther - wThis; sqlite3_str_appendchar(pOut, nNew, ' '); len = sqlite3_str_length(pOut); if( len>idxSpace ){