/*
    Copyright (C) 2002 by Eric Sunshine <sunshine@sunshineco.com>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "cssysdef.h"
#include "csutil/sysfunc.h"
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>

csString csGetUsername()
{
  csString username;
  struct passwd const* r = getpwuid(getuid());
  if (r != 0)
    username = r->pw_name;
  username.Trim();
  return username;
}

/*
    Copyright (C) 2002 by Eric Sunshine <sunshine@sunshineco.com>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "cssysdef.h"
#include "csutil/sysfunc.h"
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include "csutil/csstring.h"

csString csGetUsername()
{
  csString username;
  struct passwd const* r = getpwuid(getuid());
  if (r != 0)
    username = r->pw_name;
  username.Trim();
  return username;
}

Build fix for unix (return type csSting incomplete). Hope it's correct...
Build fix for unix (return type csSting incomplete). Hope it's correct...


git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@22653 8cc4aa7f-3514-0410-904f-f2cc9021211c
