From ef12e67516d224e9cd2ca3fd293dbe5ab385c75a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 22 Apr 2013 15:50:08 +0200 Subject: [PATCH] Change delta encoding of list deletions When encoding list_del commands in delta files, '_' is used as prefix but this breaks any command operating on files starting with an underscore since the command prefix becomes indistinguishable from the filename. The regression was introduced with ec8cbbbe0f20e67cbd3bd471b9ac55ceacaef7b8. Avoid this problem by using '~' as command prefix for list deletions. --- delta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delta.c b/delta.c index 1da3b75..a041f54 100644 --- a/delta.c +++ b/delta.c @@ -114,7 +114,7 @@ static inline int uci_parse_delta_tuple(struct uci_context *ctx, char **buf, str case '|': c = UCI_CMD_LIST_ADD; break; - case '_': + case '~': c = UCI_CMD_LIST_DEL; break; } @@ -459,7 +459,7 @@ int uci_save(struct uci_context *ctx, struct uci_package *p) prefix = "|"; break; case UCI_CMD_LIST_DEL: - prefix = "_"; + prefix = "~"; break; default: break; -- 2.11.0