From 7d3cd9267942cf8d04a84acd4f9f25b1b1b97812 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 29 Feb 2000 01:38:45 +0000 Subject: [PATCH] change this to a wstring. not part of the build. --- xpfe/appshell/public/nsIUserInfo.idl | 2 +- xpfe/appshell/src/nsUserInfoUnix.cpp | 10 ++++++---- xpfe/components/startup/public/nsIUserInfo.idl | 2 +- xpfe/components/startup/src/nsUserInfoUnix.cpp | 10 ++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/xpfe/appshell/public/nsIUserInfo.idl b/xpfe/appshell/public/nsIUserInfo.idl index 054b427f984..6591d52b9d5 100644 --- a/xpfe/appshell/public/nsIUserInfo.idl +++ b/xpfe/appshell/public/nsIUserInfo.idl @@ -27,7 +27,7 @@ interface nsIUserInfo : nsISupports { /* the system may know our user's fullname*/ - readonly attribute string fullname; + readonly attribute wstring fullname; }; %{C++ diff --git a/xpfe/appshell/src/nsUserInfoUnix.cpp b/xpfe/appshell/src/nsUserInfoUnix.cpp index 81797c7e546..a583e86c371 100644 --- a/xpfe/appshell/src/nsUserInfoUnix.cpp +++ b/xpfe/appshell/src/nsUserInfoUnix.cpp @@ -24,11 +24,10 @@ #include "nsUserInfo.h" #include "nsCRT.h" -#ifdef XP_UNIX #include #include #include -#endif /* XP_UNIX */ +#include "nsString.h" nsUserInfo::nsUserInfo() { @@ -42,7 +41,7 @@ nsUserInfo::~nsUserInfo() NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo); NS_IMETHODIMP -nsUserInfo::GetFullname(char **aFullname) +nsUserInfo::GetFullname(PRUnichar **aFullname) { struct passwd *pw = nsnull; @@ -54,6 +53,9 @@ nsUserInfo::GetFullname(char **aFullname) printf("name = %s\n", pw->pw_gecos); #endif - *aFullname = nsCRT::strdup(pw->pw_gecos); + nsAutoString fullname(pw->pw_gecos); + + *aFullname = fullname.ToNewUnicode(); + return NS_OK; } diff --git a/xpfe/components/startup/public/nsIUserInfo.idl b/xpfe/components/startup/public/nsIUserInfo.idl index 054b427f984..6591d52b9d5 100644 --- a/xpfe/components/startup/public/nsIUserInfo.idl +++ b/xpfe/components/startup/public/nsIUserInfo.idl @@ -27,7 +27,7 @@ interface nsIUserInfo : nsISupports { /* the system may know our user's fullname*/ - readonly attribute string fullname; + readonly attribute wstring fullname; }; %{C++ diff --git a/xpfe/components/startup/src/nsUserInfoUnix.cpp b/xpfe/components/startup/src/nsUserInfoUnix.cpp index 81797c7e546..a583e86c371 100644 --- a/xpfe/components/startup/src/nsUserInfoUnix.cpp +++ b/xpfe/components/startup/src/nsUserInfoUnix.cpp @@ -24,11 +24,10 @@ #include "nsUserInfo.h" #include "nsCRT.h" -#ifdef XP_UNIX #include #include #include -#endif /* XP_UNIX */ +#include "nsString.h" nsUserInfo::nsUserInfo() { @@ -42,7 +41,7 @@ nsUserInfo::~nsUserInfo() NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo); NS_IMETHODIMP -nsUserInfo::GetFullname(char **aFullname) +nsUserInfo::GetFullname(PRUnichar **aFullname) { struct passwd *pw = nsnull; @@ -54,6 +53,9 @@ nsUserInfo::GetFullname(char **aFullname) printf("name = %s\n", pw->pw_gecos); #endif - *aFullname = nsCRT::strdup(pw->pw_gecos); + nsAutoString fullname(pw->pw_gecos); + + *aFullname = fullname.ToNewUnicode(); + return NS_OK; }