Skip to content

Commit

Permalink
Align var name to the environment variable name more closely.
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed Nov 25, 2012
1 parent 4f86b2b commit b8dd0a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/org/jruby/ext/etc/RubyEtc.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ public static IRubyObject systmpdir(ThreadContext context, IRubyObject recv) {
ByteList tmp = ByteList.create("/tmp"); // default for all platforms except Windows ByteList tmp = ByteList.create("/tmp"); // default for all platforms except Windows


if (Platform.IS_WINDOWS) { if (Platform.IS_WINDOWS) {
String localAppData = System.getenv("CSIDL_COMMON_APPDATA"); String commonAppData = System.getenv("CSIDL_COMMON_APPDATA");
// TODO: need fallback mechanism // TODO: need fallback mechanism
if (localAppData != null) tmp = ByteList.create(localAppData); if (commonAppData != null) tmp = ByteList.create(commonAppData);
} }
RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding()); RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding());
ret.untaint(context); ret.untaint(context);
Expand All @@ -408,9 +408,9 @@ public static IRubyObject sysconfdir(ThreadContext context, IRubyObject recv) {
ByteList tmp = ByteList.create(RbConfigLibrary.getSysConfDir(runtime)); // default for all platforms except Windows ByteList tmp = ByteList.create(RbConfigLibrary.getSysConfDir(runtime)); // default for all platforms except Windows


if (Platform.IS_WINDOWS) { if (Platform.IS_WINDOWS) {
String localAppDir = System.getenv("CSIDL_LOCAL_APPDATA"); String localAppData = System.getenv("CSIDL_LOCAL_APPDATA");
// TODO: need fallback mechanism // TODO: need fallback mechanism
if (localAppDir != null) tmp = ByteList.create(localAppDir); if (localAppData != null) tmp = ByteList.create(localAppData);
} }
RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding()); RubyString ret = RubyString.newString(runtime, tmp, runtime.getDefaultExternalEncoding());
ret.untaint(context); ret.untaint(context);
Expand Down

0 comments on commit b8dd0a5

Please sign in to comment.