Category : Files from Magazines
Archive   : CUJ9208.ZIP
Filename : 1008014B

 
Output of file : 1008014B contained in archive : CUJ9208.ZIP

Listing 4 -- getenv.c

* getenv function -- in-memory version */
#include
#include
#include "yfuns.h"

char *(getenv)(const char *name)
{ /* search environment list for named entry */
const char *s;
size_t n = strlen(name);

for (s = _Envp; *s; s += strlen(s) + 1)
{ /* look for name match */
if (!strncmp(s, name, n) && s[n] == '=')
return ((char *)&s[n + 1]);
}
return (NULL);
}



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9208.ZIP
Filename : 1008014B

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/