diff options
author | mp <mp@FreeBSD.org> | 2007-03-11 22:33:41 +0000 |
---|---|---|
committer | mp <mp@FreeBSD.org> | 2007-03-11 22:33:41 +0000 |
commit | a40980339b13e3b506c2317b5b4864127039eb2c (patch) | |
tree | 34aefea92d30b614247ef1f2671f2362f4761785 /contrib/tcsh/tc.vers.c | |
parent | 32837fb336d4709f0a121130a3a78f29be0db5ed (diff) | |
download | FreeBSD-src-a40980339b13e3b506c2317b5b4864127039eb2c.zip FreeBSD-src-a40980339b13e3b506c2317b5b4864127039eb2c.tar.gz |
Import of tcsh-6.15.00
Diffstat (limited to 'contrib/tcsh/tc.vers.c')
-rw-r--r-- | contrib/tcsh/tc.vers.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/contrib/tcsh/tc.vers.c b/contrib/tcsh/tc.vers.c index 1ed2160..b93e176 100644 --- a/contrib/tcsh/tc.vers.c +++ b/contrib/tcsh/tc.vers.c @@ -1,4 +1,4 @@ -/* $Header: /src/pub/tcsh/tc.vers.c,v 3.50 2004/08/04 17:12:31 christos Exp $ */ +/* $Header: /p/tcsh/cvsroot/tcsh/tc.vers.c,v 3.54 2006/03/02 18:46:45 christos Exp $ */ /* * tc.vers.c: Version dependent stuff */ @@ -33,7 +33,7 @@ #include "sh.h" #include "tw.h" -RCSID("$Id: tc.vers.c,v 3.50 2004/08/04 17:12:31 christos Exp $") +RCSID("$tcsh: tc.vers.c,v 3.54 2006/03/02 18:46:45 christos Exp $") #include "patchlevel.h" @@ -43,7 +43,7 @@ RCSID("$Id: tc.vers.c,v 3.50 2004/08/04 17:12:31 christos Exp $") * options that might affect the user. */ void -fix_version() +fix_version(void) { #ifdef WIDE_STRINGS # define SSSTR "wide" @@ -146,10 +146,10 @@ fix_version() #ifndef LOCALSTR # define LOCALSTR "" #endif /* LOCALSTR */ - char version[BUFSIZE]; - Char *machtype = tgetenv(STRMACHTYPE); - Char *vendor = tgetenv(STRVENDOR); - Char *ostype = tgetenv(STROSTYPE); + char *version; + const Char *machtype = tgetenv(STRMACHTYPE); + const Char *vendor = tgetenv(STRVENDOR); + const Char *ostype = tgetenv(STROSTYPE); if (vendor == NULL) vendor = STRunknown; @@ -159,14 +159,17 @@ fix_version() ostype = STRunknown; - (void) xsnprintf(version, sizeof(version), + version = xasprintf( "tcsh %d.%.2d.%.2d (%s) %s (%S-%S-%S) options %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", REV, VERS, PATCHLEVEL, ORIGIN, DATE, machtype, vendor, ostype, SSSTR, NLSSTR, LFSTR, DLSTR, VISTR, DTRSTR, BYESTR, ALSTR, KANSTR, SMSTR, HBSTR, NGSTR, RHSTR, AFSSTR, NDSTR, COLORSTR, DSPMSTR, CCATSTR, FILECSTR, LOCALSTR); - set(STRversion, SAVE(version), VAR_READWRITE); - (void) xsnprintf(version, sizeof(version), "%d.%.2d.%.2d", - REV, VERS, PATCHLEVEL); - set(STRtcsh, SAVE(version), VAR_READWRITE); + cleanup_push(version, xfree); + setcopy(STRversion, str2short(version), VAR_READWRITE); + cleanup_until(version); + version = xasprintf("%d.%.2d.%.2d", REV, VERS, PATCHLEVEL); + cleanup_push(version, xfree); + setcopy(STRtcsh, str2short(version), VAR_READWRITE); + cleanup_until(version); } |