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/ar.cc
          +++ new/usr/src/cmd/make/bin/ar.cc
↓ open down ↓ 191 lines elided ↑ open up ↑
 192  192                                                               member names */
 193  193  
 194  194          member = get_prop(target->prop, member_prop);
 195  195          /*
 196  196           * Check if the member has directory component.
 197  197           * If so, remove the dir and see if we know the date.
 198  198           */
 199  199          if (member->body.member.member != NULL) {
 200  200                  Wstring member_string(member->body.member.member);
 201  201                  wchar_t * wcb = member_string.get_string();
 202      -                if((slash = (wchar_t *) wsrchr(wcb, (int) slash_char)) != NULL) {
      202 +                if((slash = (wchar_t *) wcsrchr(wcb, (int) slash_char)) != NULL) {
 203  203                          INIT_STRING_FROM_STACK(true_member_name, buffer);
 204  204                          append_string(member->body.member.library->string_mb,
 205  205                                        &true_member_name,
 206  206                                        FIND_LENGTH);
 207  207                          append_char((int) parenleft_char, &true_member_name);
 208  208                          append_string(slash + 1, &true_member_name, FIND_LENGTH);
 209  209                          append_char((int) parenright_char, &true_member_name);
 210  210                          true_member = GETNAME(true_member_name.buffer.start,
 211  211                                                FIND_LENGTH);
 212  212                          if (true_member->stat.time != file_no_time) {
↓ open down ↓ 447 lines elided ↑ open up ↑
 660  660                                  if ((fseek(arp->fd,
 661  661                                             sgetl(arp->ars_5.sym_ptr),
 662  662                                             0) != 0) ||
 663  663                                      (fread((char *) &arp->arf_5,
 664  664                                             sizeof arp->arf_5,
 665  665                                             1,
 666  666                                             arp->fd) != 1)) {
 667  667                                          goto read_error;
 668  668                                  }
 669  669                                  MBSTOWCS(wcs_buffer, arp->arf_5.arf_name);
 670      -                                (void) wsncpy(member_string,
      670 +                                (void) wcsncpy(member_string,
 671  671                                                wcs_buffer,
 672      -                                              wslen(wcs_buffer));
      672 +                                              wcslen(wcs_buffer));
 673  673                                  member_string[sizeof(arp->arf_5.arf_name)] =
 674  674                                                                  (int) nul_char;
 675  675                                  member->body.member.member =
 676  676                                          GETNAME(member_string, FIND_LENGTH);
 677  677                                  target->stat.time.tv_sec = sgetl(arp->arf_5.arf_date);
 678  678                                  target->stat.time.tv_nsec = LONG_MAX;
 679  679                                  return;
 680  680                          }
 681  681                  }
 682  682                  break;
↓ open down ↓ 164 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX