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/macro.cc
          +++ new/usr/src/cmd/make/bin/macro.cc
↓ open down ↓ 117 lines elided ↑ open up ↑
 118  118          Envvar                  p;
 119  119          String_rec              value;
 120  120  
 121  121          for (p = envvar; p != NULL; p = p->next) {
 122  122                  if (p->already_put
 123  123                      ) {
 124  124                          continue;
 125  125                  }
 126  126                  INIT_STRING_FROM_STACK(value, buffer);          
 127  127                  expand_value(p->value, &value, false);
 128      -                if ((length = wslen(value.buffer.start)) >= MAXPATHLEN) {
      128 +                if ((length = wcslen(value.buffer.start)) >= MAXPATHLEN) {
 129  129                          mbs = tmp_mbs_buffer = getmem((length + 1) * MB_LEN_MAX);
 130  130                          (void) wcstombs(mbs,
 131  131                                          value.buffer.start,
 132  132                                          (length + 1) * MB_LEN_MAX);
 133  133                  } else {
 134  134                          mbs = mbs_buffer;
 135  135                          WCSTOMBS(mbs, value.buffer.start);
 136  136                  }
 137  137                  length = 2 + strlen(p->name->string_mb) + strlen(mbs);
 138  138                  if (!p->already_put || length > (MAXPATHLEN * MB_LEN_MAX)) {
↓ open down ↓ 29 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX