~ruther/guix-local

65ed7a61f1ad01da440f0e7e08bfc32b43deed73 — Tobias Geerinckx-Rice 2 years ago 2e0228e
uuid: Fix NTFS UUID stringification.

Previously, (ntfs-uuid->string (string->ntfs-uuid"5234ED0D34ECF53F"))
would yield "5234EDD34ECF53F".

Reported by sughosha in #guix.

* gnu/system/uuid.scm (ntfs-uuid->string): Pad hex bytes with zero when
needed.
1 files changed, 1 insertions(+), 1 deletions(-)

M gnu/system/uuid.scm
M gnu/system/uuid.scm => gnu/system/uuid.scm +1 -1
@@ 209,7 209,7 @@ ISO9660 UUID representation."

(define (ntfs-uuid->string uuid)
  "Convert NTFS UUID, a 8-byte bytevector, to its string representation."
  (format #f "~{~:@(~x~)~}" (reverse (bytevector->u8-list uuid))))
  (format #f "~{~:@(~2,'0x~)~}" (reverse (bytevector->u8-list uuid))))

(define %ntfs-uuid-rx
  (make-regexp "^([[:xdigit:]]{16})$"))