Fossil SCM

Escape "~" in blob_append_escaped_arg() on Unix. An argument that began with "~" went to the shell unquoted and was replaced by a home directory, so that the path in ssh://host/~/repo.fossil was expanded on the local machine and not on the server. A setting whose value begins with a literal "~" is no longer expanded when it is passed as an argument.

dmestas 2026-11-14 16:37 UTC ssh-arg-quoting
Commit 78d801eceb21fcb21508fd4c869356fde40eb166d3ccf9ecc30d03bbd07c4d06
1 file changed +2 -2
+2 -2
--- src/blob.c
+++ src/blob.c
@@ -1690,21 +1690,21 @@
16901690
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
16911691
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 7x */
16921692
#else
16931693
/* Unix
16941694
** Prohibit: all control characters, including tab, \r and \n
1695
-** Escape: (space) ! " # $ % & ' ( ) * ; < > ? [ \ ] ^ ` { | }
1695
+** Escape: (space) ! " # $ % & ' ( ) * ; < > ? [ \ ] ^ ` { | } ~
16961696
*/
16971697
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
16981698
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x */
16991699
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1x */
17001700
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 2x */
17011701
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, /* 3x */
17021702
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4x */
17031703
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 5x */
17041704
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
1705
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 7x */
1705
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /* 7x */
17061706
#endif
17071707
/* all bytes 0x80 through 0xbf are unescaped, being secondary
17081708
** bytes to UTF8 characters. Bytes 0xc0 through 0xff are the
17091709
** first byte of a UTF8 character and do get escaped */
17101710
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 8x */
17111711
--- src/blob.c
+++ src/blob.c
@@ -1690,21 +1690,21 @@
1690 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
1691 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 7x */
1692 #else
1693 /* Unix
1694 ** Prohibit: all control characters, including tab, \r and \n
1695 ** Escape: (space) ! " # $ % & ' ( ) * ; < > ? [ \ ] ^ ` { | }
1696 */
1697 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x */
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1x */
1700 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 2x */
1701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, /* 3x */
1702 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4x */
1703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 5x */
1704 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
1705 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 7x */
1706 #endif
1707 /* all bytes 0x80 through 0xbf are unescaped, being secondary
1708 ** bytes to UTF8 characters. Bytes 0xc0 through 0xff are the
1709 ** first byte of a UTF8 character and do get escaped */
1710 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 8x */
1711
--- src/blob.c
+++ src/blob.c
@@ -1690,21 +1690,21 @@
1690 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
1691 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, /* 7x */
1692 #else
1693 /* Unix
1694 ** Prohibit: all control characters, including tab, \r and \n
1695 ** Escape: (space) ! " # $ % & ' ( ) * ; < > ? [ \ ] ^ ` { | } ~
1696 */
1697 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x */
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1x */
1700 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 2x */
1701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, /* 3x */
1702 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4x */
1703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* 5x */
1704 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */
1705 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /* 7x */
1706 #endif
1707 /* all bytes 0x80 through 0xbf are unescaped, being secondary
1708 ** bytes to UTF8 characters. Bytes 0xc0 through 0xff are the
1709 ** first byte of a UTF8 character and do get escaped */
1710 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 8x */
1711

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button