From: Jo-Philipp Wich Date: Mon, 22 Apr 2013 13:50:08 +0000 (+0200) Subject: Change delta encoding of list deletions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ef12e67516d224e9cd2ca3fd293dbe5ab385c75a;p=project%2Fuci.git 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. --- 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;