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/read.cc
          +++ new/usr/src/cmd/make/lib/mksh/read.cc
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28   *      read.c
  29   29   *
  30   30   *      This file contains the makefile reader.
  31   31   */
  32   32  
  33   33  /*
  34   34   * Included files
  35   35   */
  36   36  #include <mksh/misc.h>          /* retmem() */
  37   37  #include <mksh/read.h>
  38      -#include <mksdmsi18n/mksdmsi18n.h>
  39   38  #include <sys/uio.h>            /* read() */
  40   39  #include <unistd.h>             /* close(), unlink(), read() */
       40 +#include <libintl.h>
  41   41  
  42   42  #define STRING_LEN_TO_CONVERT   (8*1024)
  43   43  
  44   44  /*
  45   45   *      get_next_block_fn(source)
  46   46   *
  47   47   *      Will get the next block of text to read either
  48   48   *      by popping one source bVSIZEOFlock of the stack of Sources
  49   49   *      or by reading some more from the makefile.
  50   50   *
↓ open down ↓ 52 lines elided ↑ open up ↑
 103  103           * Read the whole makefile.
 104  104           * Hopefully the kernel managed to prefetch the stuff.
 105  105           */
 106  106                  to_read = source->bytes_left_in_file;
 107  107                  source->inp_buf_ptr = source->inp_buf = getmem(to_read + 1);
 108  108                  source->inp_buf_end = source->inp_buf + to_read;
 109  109                  length = read(source->fd, source->inp_buf, (unsigned int) to_read);
 110  110                  if (length != to_read) {
 111  111                          WCSTOMBS(mbs_buffer, file_being_read);
 112  112                          if (length == 0) {
 113      -                                fatal_mksh(catgets(libmksdmsi18n_catd, 1, 140, "Error reading `%s': Premature EOF"),
      113 +                                fatal_mksh(gettext("Error reading `%s': Premature EOF"),
 114  114                                        mbs_buffer);
 115  115                          } else {
 116      -                                fatal_mksh(catgets(libmksdmsi18n_catd, 1, 141, "Error reading `%s': %s"),
      116 +                                fatal_mksh(gettext("Error reading `%s': %s"),
 117  117                                        mbs_buffer,
 118  118                                        errmsg(errno));
 119  119                          }
 120  120                  }
 121  121                  *source->inp_buf_end = nul_char;
 122  122                  source->bytes_left_in_file = 0;
 123  123          }
 124  124          /*
 125  125           * Try to convert the next piece.
 126  126           */
↓ open down ↓ 19 lines elided ↑ open up ↑
 146  146          }
 147  147  
 148  148          source->error_converting = false;
 149  149          source->inp_buf_ptr = ptr;
 150  150          source->string.text.end += num_wc_chars;
 151  151          *source->string.text.end = 0;
 152  152  
 153  153          if (source->inp_buf_ptr >= source->inp_buf_end) {
 154  154                  if (*(source->string.text.end - 1) != (int) newline_char) {
 155  155                          WCSTOMBS(mbs_buffer, file_being_read);
 156      -                        warning_mksh(catgets(libmksdmsi18n_catd, 1, 142, "newline is not last character in file %s"),
      156 +                        warning_mksh(gettext("newline is not last character in file %s"),
 157  157                                               mbs_buffer);
 158  158                          *source->string.text.end++ = (int) newline_char;
 159  159                          *source->string.text.end = (int) nul_char;
 160  160                          *source->string.buffer.end++;
 161  161                  }
 162  162                  if (source->inp_buf != NULL) {
 163  163                          retmem_mb(source->inp_buf);
 164  164                          source->inp_buf = NULL;
 165  165                  }
 166  166          }
 167  167          return source;
 168  168  }
 169  169  
 170  170  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX