From 60ffd9ef7acc706f8b3220f400772a68cf798618 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 8 Jun 2011 01:29:34 +0100 Subject: [PATCH] config: never let user name be null or empty --- SparkleLib/SparkleConfig.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index 614d1fb9..e9603269 100644 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -56,7 +56,7 @@ namespace SparkleLib { private void CreateInitialConfig () { - string user_name = "Unknown"; + string user_name = Environment.UserName; if (SparkleBackend.Platform == PlatformID.Unix || SparkleBackend.Platform == PlatformID.MacOSX) { @@ -64,12 +64,10 @@ namespace SparkleLib { user_name = new UnixUserInfo (UnixEnvironment.UserName).RealName; user_name = user_name.TrimEnd (",".ToCharArray()); - } else { - user_name = Environment.UserName; } if (string.IsNullOrEmpty (user_name)) - user_name = "Unknown"; + user_name = Environment.UserName; TextWriter writer = new StreamWriter (Path); string n = Environment.NewLine;