Print this page
make: use the more modern wchar routines, not widec.h

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/read.cc
          +++ new/usr/src/cmd/make/bin/read.cc
↓ open down ↓ 343 lines elided ↑ open up ↑
 344  344                  MBSTOWCS(wcs_buffer, "Standard in");
 345  345                  makefile_name = GETNAME(wcs_buffer, FIND_LENGTH);
 346  346                  /*
 347  347                   * Memory to read standard in, then convert it
 348  348                   * to wide char strings.
 349  349                   */
 350  350                  stdin_buffer_start =
 351  351                    stdin_text_p = getmem(length = 1024);
 352  352                  stdin_buffer_end = stdin_text_p + length;
 353  353                  MBSTOWCS(wcs_buffer, "standard input");
 354      -                file_being_read = (wchar_t *) wsdup(wcs_buffer);
      354 +                file_being_read = (wchar_t *) wcsdup(wcs_buffer);
 355  355                  line_number = 0;
 356  356                  while ((n = read(fileno(stdin),
 357  357                                   stdin_text_p,
 358  358                                   length)) > 0) {
 359  359                          length -= n;
 360  360                          stdin_text_p += n;
 361  361                          if (length == 0) {
 362  362                                  p_mb = getmem(length = 1024 +
 363  363                                                (stdin_buffer_end -
 364  364                                                 stdin_buffer_start));
↓ open down ↓ 455 lines elided ↑ open up ↑
 820  820                                              (name_start[1] == (int) slash_char)) {
 821  821                                                  name_start += 2;
 822  822                                                  name_length -= 2;
 823  823                                          }
 824  824  
 825  825                                          INIT_STRING_FROM_STACK(include_name, include_buffer);
 826  826                                          APPEND_NAME(true_makefile_name,
 827  827                                                        &include_name,
 828  828                                                        true_makefile_name->hash.length);
 829  829  
 830      -                                        wchar_t *slash = wsrchr(include_name.buffer.start, (int) slash_char);
      830 +                                        wchar_t *slash = wcsrchr(include_name.buffer.start, (int) slash_char);
 831  831                                          if (slash != NULL) {
 832  832                                                  include_name.text.p = slash + 1;
 833  833                                                  append_string(name_start,
 834  834                                                                &include_name,
 835  835                                                                name_length);
 836  836  
 837  837                                                  name_start = include_name.buffer.start;
 838  838                                                  name_length = include_name.text.p - name_start; 
 839  839                                          }
 840  840                                  }
↓ open down ↓ 1308 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX