summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-04-22 15:50:08 +0200
committerJo-Philipp Wich <jow@openwrt.org>2013-04-22 16:01:25 +0200
commitef12e67516d224e9cd2ca3fd293dbe5ab385c75a (patch)
tree0b9abf4a57c4a5c222725c788325646fb9e4724f
parent1e1f503d8fb8336da22029faaa1a7252bed22976 (diff)
downloaduci-ef12e67516d224e9cd2ca3fd293dbe5ab385c75a.tar.gz
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.
-rw-r--r--delta.c4
1 files 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;