Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/tex/kpathsea/xputenv.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <kpathsea/config.h>

void
xputenv P2C(const_string, var_name,  const_string, value)
{
  string new_item = concat3 (var_name, "=", value);
  unsigned name_len = strlen (var_name);
  if (putenv (new_item) < 0)
        FATAL1 ("putenv (%s) failed", new_item);

   free (new_item);
}

void
xputenv_int P2C(const_string, var_name,  int, num)
{
  char str[MAX_INT_LENGTH];
  sprintf (str, "%d", num);
  
  xputenv (var_name, str);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].