Skip to content

Commit 076b4e7

Browse files
committed
Fix backref in C string, need escape
[GitHub link #23]
1 parent 2feaac6 commit 076b4e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/chsrc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ ensure_apt_sourcelist (int debian_type)
867867
chsrc_warn_remarkably (ETC_APT_SOURCELIST " 文件缺失,将替补")
868868
}
869869

870-
char *codename = xy_run ("sed -nr 's/VERSION_CODENAME=(.*)/\1/p' " ETC_OSRELEASE, 0, NULL);
870+
// 反向引用需要escape一下
871+
char *codename = xy_run ("sed -nr 's/VERSION_CODENAME=(.*)/\\1/p' " ETC_OSRELEASE, 0, NULL);
871872
codename = xy_str_delete_suffix (codename, "\n");
872873

873874
char *makeup = NULL;

0 commit comments

Comments
 (0)