From: Junio C Hamano Date: Sat, 16 Apr 2005 15:30:20 +0000 (-0700) Subject: [PATCH] Byteorder fix for read-tree, new -m semantics version. X-Git-Tag: v0.99~869 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fcf712e60e3221a7971cb2ad89e61c565172f524;p=git.git [PATCH] Byteorder fix for read-tree, new -m semantics version. 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. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- diff --git a/cache.h b/cache.h index cc8f686b6..b48884225 100644 --- a/cache.h +++ b/cache.h @@ -66,7 +66,7 @@ struct cache_entry { #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;