Skip to content

Commit

Permalink
Replace username space with underscore.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkraljevic committed Sep 6, 2013
1 parent 106fa38 commit 6142567
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ WIPE_TMP=true
# Calculate MYNAME based on platform.
if [ ! -z "$LOGNAME" ]; then
# Unix
MYNAME=${LOGNAME}
MYNAME=`echo ${LOGNAME} | sed 's/ /_/g'`
else
if [ ! -z "$USERNAME" ]; then
# Windows
MYNAME=${USERNAME}
MYNAME=`echo ${USERNAME} | sed 's/ /_/g'`
else
MYNAME="UnknownLogin"
fi
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/water/H2O.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public final class H2O {

public static String DEFAULT_ICE_ROOT() {
String username = System.getProperty("user.name");
if ((username == null) || (username.length() == 0)) {
if (username == null) {
username = "";
}
String u2 = username.replaceAll(" ", "_");
if (username.length() == 0) {
username = "unknown";
}
String s = "/tmp/h2o-" + username;
Expand Down

0 comments on commit 6142567

Please sign in to comment.