Remove dependency on xmalloc.

Remove ssh_get_progname's dependency on xmalloc, which should reduce
link order problems.  ok djm@
This commit is contained in:
Darren Tucker 2015-02-26 04:12:58 +11:00
parent 5d5ec165c5
commit 678e473e2a
1 changed files with 7 additions and 7 deletions

View File

@ -31,8 +31,6 @@
#include <time.h>
#include <unistd.h>
#include "xmalloc.h"
#ifndef HAVE___PROGNAME
char *__progname;
#endif
@ -43,13 +41,12 @@ char *__progname;
*/
char *ssh_get_progname(char *argv0)
{
char *p, *q;
#ifdef HAVE___PROGNAME
extern char *__progname;
return xstrdup(__progname);
p = __progname;
#else
char *p;
if (argv0 == NULL)
return ("unknown"); /* XXX */
p = strrchr(argv0, '/');
@ -57,9 +54,12 @@ char *ssh_get_progname(char *argv0)
p = argv0;
else
p++;
return (xstrdup(p));
#endif
if ((q = strdup(p)) == NULL) {
perror("strdup");
exit(1);
}
return q;
}
#ifndef HAVE_SETLOGIN