[PATCH] Byteorder fix for read-tree, new -m semantics version.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 16, 2005, 09:27 UTC
- Message-ID
- <7vacnzcbrn.fsf_-_@assigned-by-dhcp.cox.net>
- In-Reply-To
- <7vis2ncf8j.fsf@assigned-by-dhcp.cox.net>
The ce_namelen field has been renamed to ce_flags and split into the top 2-bit unused, next 2-bit stage number and the lowest 12-bit name-length, stored in the network byte order. A new macro create_ce_flags() is defined to synthesize this value from length and stage, but it forgets to turn the value into the network byte order. Here is a fix.
The patch is against 9c03bd47892d11d0bb28c442184786db3c189978.
Signed-off-by: Junio C Hamano <junkio@cox.net> ---
cache.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
--- cache.h +++ cache.h 2005-04-16 02:22:05.000000000 -0700
@@ -66,7 +66,7 @@ #define CE_NAMEMASK (0x0fff) #define CE_STAGEMASK (0x3000) -#define create_ce_flags(len, stage) ((len) | ((stage) << 12)) +#define create_ce_flags(len, stage) htons((len) | ((stage) << 12)) const char *sha1_file_directory; struct cache_entry **active_cache;