mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Replace octal characters from mounts in /proc/mounts
Fixed: Replace octal characters in mount points Closes #1295
This commit is contained in:
@@ -105,5 +105,17 @@ namespace NzbDrone.Common.Extensions
|
||||
{
|
||||
return string.Concat(Array.ConvertAll(input, x => x.ToString("X2")));
|
||||
}
|
||||
|
||||
public static string FromOctalString(this string octalValue)
|
||||
{
|
||||
octalValue = octalValue.TrimStart('\\');
|
||||
|
||||
var first = int.Parse(octalValue.Substring(0, 1));
|
||||
var second = int.Parse(octalValue.Substring(1, 1));
|
||||
var third = int.Parse(octalValue.Substring(2, 1));
|
||||
var byteResult = (byte)((first << 6) | (second << 3) | (third));
|
||||
|
||||
return Encoding.ASCII.GetString(new [] { byteResult });
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user