Skip to content

Commit b524681

Browse files
committed
sys.device: locale agnostic
1 parent 54f33bb commit b524681

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

+stdlib/+sys/device.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
[s, m] = system(cmd);
3131
if s == 0
3232
if ispc()
33-
r = extractAfter(m, 'Volume Serial Number is ');
34-
r = [r(1:4) r(6:9)];
35-
i = hex2dec(r);
33+
r = regexp(m, '[A-F0-9]{4}-[A-F0-9]{4}', 'match', 'once');
34+
if strlength(r) == 9
35+
r = [r(1:4) r(6:9)];
36+
i = hex2dec(r);
37+
end
3638
else
3739
i = str2double(m);
3840
end

0 commit comments

Comments
 (0)