Print this page
make: translate using gettext, rather than the unmaintainable catgets

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/lib/mksh/mksh.cc
          +++ new/usr/src/cmd/make/lib/mksh/mksh.cc
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29   *
  30   30   *      Execute the command(s) of one Make or DMake rule
  31   31   */
  32   32  
  33   33  /*
  34   34   * Included files
  35   35   */
  36   36  #include <mksh/dosys.h>         /* redirect_io() */
  37   37  #include <mksh/misc.h>          /* retmem() */
  38   38  #include <mksh/mksh.h>
  39      -#include <mksdmsi18n/mksdmsi18n.h>
  40   39  #include <errno.h>
  41   40  #include <signal.h>
  42   41  
  43   42  
  44   43  /*
  45   44   * Workaround for NFS bug. Sometimes, when running 'chdir' on a remote
  46   45   * dmake server, it fails with "Stale NFS file handle" error.
  47   46   * The second attempt seems to work.
  48   47   */
  49   48  int
↓ open down ↓ 24 lines elided ↑ open up ↑
  74   73               *env_list_p != (char *) NULL;
  75   74               env_list_p++) {
  76   75                  putenv(*env_list_p);
  77   76          }
  78   77  }
  79   78  
  80   79  static void
  81   80  init_mksh_globals(char *shell)
  82   81  {
  83   82  /*
  84      -        MBSTOWCS(wcs_buffer, NOCATGETS("SHELL"));
       83 +        MBSTOWCS(wcs_buffer, "SHELL");
  85   84          shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
  86   85          MBSTOWCS(wcs_buffer, shell);
  87   86          (void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
  88   87   */
  89   88          char * dmake_shell;
  90      -        if ((dmake_shell = getenv(NOCATGETS("DMAKE_SHELL"))) == NULL) {
       89 +        if ((dmake_shell = getenv("DMAKE_SHELL")) == NULL) {
  91   90                  dmake_shell = shell;
  92   91          } 
  93   92          MBSTOWCS(wcs_buffer, dmake_shell);
  94   93          shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
  95   94  }
  96   95  
  97   96  /*
  98   97   * Change the pathname in the value of the SUNPRO_DEPENDENCIES env variable
  99   98   * from oldpath to newpath.
 100   99   */
 101  100  static void
 102  101  change_sunpro_dependencies_value(char *oldpath, char *newpath)
 103  102  {
 104  103          char            buf[MAXPATHLEN];
 105  104          static char     *env;
 106  105          int             length;
 107  106          int             oldpathlen;
 108  107          char            *sp_dep_value;
 109  108  
 110  109          /* check if SUNPRO_DEPENDENCIES is set in the environment */
 111      -        if ((sp_dep_value = getenv(NOCATGETS("SUNPRO_DEPENDENCIES"))) != NULL) {
      110 +        if ((sp_dep_value = getenv("SUNPRO_DEPENDENCIES")) != NULL) {
 112  111                  oldpathlen = strlen(oldpath);
 113  112                  /* check if oldpath is indeed in the value of SUNPRO_DEPENDENCIES */
 114  113                  if (strncmp(oldpath, sp_dep_value, oldpathlen) == 0) {
 115  114                          (void) sprintf(buf,
 116  115                                         "%s%s",
 117  116                                         newpath,
 118  117                                         sp_dep_value + oldpathlen);
 119  118                          length = 2 +
 120      -                                strlen(NOCATGETS("SUNPRO_DEPENDENCIES")) +
      119 +                                strlen("SUNPRO_DEPENDENCIES") +
 121  120                                  strlen(buf);
 122  121                          env = getmem(length);
 123  122                          (void) sprintf(env,
 124  123                                         "%s=%s",
 125      -                                       NOCATGETS("SUNPRO_DEPENDENCIES"),
      124 +                                       "SUNPRO_DEPENDENCIES",
 126  125                                         buf);
 127  126                          (void) putenv(env);
 128  127                  }
 129  128          }
 130  129  }
 131  130  
 132  131  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX