diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-08-15 13:05:10 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-08-15 13:05:10 +0800 |
commit | 25ac9df6116c1e90f768374b71f1a1b54b0df430 (patch) | |
tree | 4f8e69b0a3f69b3c015fd13456bf862f1407f024 /util/outmail.c | |
parent | 700ad96bde7769ed9c7fd5f4fc248e93fba8af2f (diff) | |
download | pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar.gz pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar.bz2 pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar.lz pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar.xz pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.tar.zst pttbbs-25ac9df6116c1e90f768374b71f1a1b54b0df430.zip |
clean the source
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1095 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/outmail.c')
-rw-r--r-- | util/outmail.c | 72 |
1 files changed, 1 insertions, 71 deletions
diff --git a/util/outmail.c b/util/outmail.c index d8efb526..f818d2c6 100644 --- a/util/outmail.c +++ b/util/outmail.c @@ -1,4 +1,4 @@ -/* $Id: outmail.c,v 1.5 2003/04/19 18:36:10 in2 Exp $ */ +/* $Id$ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -16,76 +16,6 @@ #include "pttstruct.h" -#ifdef HAVE_SETPROCTITLE - -#include <sys/types.h> -#include <libutil.h> - -void initsetproctitle(int argc, char **argv, char **envp) { -} - -#else - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <stdarg.h> - -char **Argv = NULL; /* pointer to argument vector */ -char *LastArgv = NULL; /* end of argv */ -extern char **environ; - -void initsetproctitle(int argc, char **argv, char **envp) { - register int i; - - /* Move the environment so setproctitle can use the space at - the top of memory. */ - for(i = 0; envp[i]; i++); - environ = malloc(sizeof(char *) * (i + 1)); - for(i = 0; envp[i]; i++) - environ[i] = strdup(envp[i]); - environ[i] = NULL; - - /* Save start and extent of argv for setproctitle. */ - Argv = argv; - if(i > 0) - LastArgv = envp[i - 1] + strlen(envp[i - 1]); - else - LastArgv = argv[argc - 1] + strlen(argv[argc - 1]); -} - -static void do_setproctitle(const char *cmdline) { - char buf[256], *p; - int i; - - strncpy(buf, cmdline, 256); - buf[255] = '\0'; - i = strlen(buf); - if(i > LastArgv - Argv[0] - 2) { - i = LastArgv - Argv[0] - 2; - } - strcpy(Argv[0], buf); - p = &Argv[0][i]; - while(p < LastArgv) - *p++='\0'; - Argv[1] = NULL; -} - -void setproctitle(const char* format, ...) { - char buf[256]; - - va_list args; - va_start(args, format); - vsprintf(buf, format,args); - do_setproctitle(buf); - va_end(args); -} -#endif - - - - - #define SPOOL BBSHOME "/out" #define INDEX SPOOL "/.DIR" #define NEWINDEX SPOOL "/.DIR.sending" |