]> err.no Git - util-linux/commitdiff
blkid: add HFS and HFS+
authorKarel Zak <kzak@redhat.com>
Thu, 9 Oct 2008 10:00:20 +0000 (12:00 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:46 +0000 (23:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probe.c
libs/blkid/src/probers/Makefile.am
libs/blkid/src/probers/probers.h

index 0872a0eae71ea883c3568c70b3c798bbfc31fd70..ee59c2c7449a93175e6ed764fc45a7c57e2c58bf 100644 (file)
@@ -63,7 +63,9 @@ static const struct blkid_idinfo *idinfos[] =
        &oracleasm_idinfo,
        &reiser_idinfo,
        &reiser4_idinfo,
-       &jbd_idinfo
+       &jbd_idinfo,
+       &hfsplus_idinfo,
+       &hfs_idinfo
 };
 
 #ifndef ARRAY_SIZE
@@ -541,8 +543,7 @@ static size_t encode_to_utf8(int enc, unsigned char *dest, size_t len,
        size_t i, j;
        uint16_t c;
 
-       j = 0;
-       for (i = 0; i + 2 <= count; i += 2) {
+       for (j = i = 0; i + 2 <= count; i += 2) {
                if (enc == BLKID_ENC_UTF16LE)
                        c = (src[i+1] << 8) | src[i];
                else /* BLKID_ENC_UTF16BE */
@@ -584,8 +585,8 @@ int blkid_probe_set_utf8label(blkid_probe pr, unsigned char *label,
        v = blkid_probe_assign_value(pr, "LABEL");
        if (!v)
                return -1;
+
        v->len = encode_to_utf8(enc, v->data, sizeof(v->data), label, len);
-       v->len++; /* \0 */
        return 0;
 }
 
index 790bf782a6eb176923795514ab8f61ccab402dfc..67a68183898ac5846bb77f325cb792082e046229 100644 (file)
@@ -23,6 +23,7 @@ libprobers_a_SOURCES =        probers.h \
                        gfs.c \
                        ocfs.c \
                        reiserfs.c \
-                       romfs.c
+                       romfs.c \
+                       hfs.c
 
 all-local: $(lib_LIBRARIES)
index 7acf33e2e073058202811fb7e091d54c28c0866c..4a44a22e1891bf699079108e48356e5270e60a6e 100644 (file)
@@ -43,6 +43,8 @@ extern const struct blkid_idinfo ocfs2_idinfo;
 extern const struct blkid_idinfo oracleasm_idinfo;
 extern const struct blkid_idinfo reiser_idinfo;
 extern const struct blkid_idinfo reiser4_idinfo;
+extern const struct blkid_idinfo hfs_idinfo;
+extern const struct blkid_idinfo hfsplus_idinfo;
 
 
 #endif /* _BLKID_PROBE_H */