aboutsummaryrefslogtreecommitdiffstats
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-16 08:30:20 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 08:30:20 -0700
commitfcf712e60e3221a7971cb2ad89e61c565172f524 (patch)
treea4944100a4832f8fce1494e2e8cbea74e349f731 /cache.h
parentd99082e0e3436f5fcf259aa1a4189473f6bb5ce3 (diff)
downloadgit-fcf712e60e3221a7971cb2ad89e61c565172f524.tar.gz
[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 <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index cc8f686b66..b48884225d 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;