Changeset 5754:b23d79c13370 in roaraudio for libroarpulse/util.c
- Timestamp:
- 11/16/12 16:49:56 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroarpulse/util.c
r5381 r5754 73 73 /** Return the current username in the specified string buffer. */ 74 74 char *pa_get_user_name(char *s, size_t l) { 75 c har * user = NULL;75 const char * user = NULL; 76 76 77 77 if ( s == NULL ) { … … 82 82 83 83 if ( user == NULL ) 84 user = getenv("USER");84 user = roar_env_get("USER"); 85 85 if ( user == NULL ) 86 user = getenv("LOGNAME");86 user = roar_env_get("LOGNAME"); 87 87 if ( user == NULL ) 88 user = getenv("USERNAME");88 user = roar_env_get("USERNAME"); 89 89 90 90 #ifdef ROAR_HAVE_GETUID … … 126 126 /** Return the home directory of the current user */ 127 127 char *pa_get_home_dir(char *s, size_t l) { 128 char * home = getenv("HOME"); 129 130 if ( home == NULL ) 128 if ( roar_env_render_path_r(s, l, "~/") == -1 ) 131 129 return NULL; 132 133 strncpy(s, home, l);134 135 s[l-1] = 0;136 130 137 131 return s;
Note: See TracChangeset
for help on using the changeset viewer.