Skip to content

Commit 40fe398

Browse files
committed
BuildTools : getOSRelease() : remove quotes if any
1 parent df33823 commit 40fe398

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/javaforce/utils/BuildTools.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ public static String getOSRelease(String name) {
146146
FileInputStream fis = new FileInputStream("/etc/os-release");
147147
os_release.load(fis);
148148
fis.close();
149-
return os_release.getProperty(name);
149+
String value = os_release.getProperty(name);
150+
if (value == null) return null;
151+
int strlen = value.length();
152+
if ((value.charAt(0) == '\"') && (value.charAt(strlen-1) == '\"')) {
153+
//remove quotes
154+
value = value.substring(1, strlen-1);
155+
}
156+
return value;
150157
} catch (Exception e) {
151158
return "null";
152159
}

0 commit comments

Comments
 (0)