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

*** 229,239 **** while ((*vpath != (int) colon_char) && (*vpath != (int) nul_char)) { *name_p++ = *vpath++; } *name_p++ = (int) slash_char; ! (void) wscpy(name_p, wcb1.get_string()); alias = GETNAME(file_name, FIND_LENGTH); if (exists(alias) != file_doesnt_exist) { target->stat.is_file = true; target->stat.mode = alias->stat.mode; target->stat.size = alias->stat.size; --- 229,239 ---- while ((*vpath != (int) colon_char) && (*vpath != (int) nul_char)) { *name_p++ = *vpath++; } *name_p++ = (int) slash_char; ! (void) wcscpy(name_p, wcb1.get_string()); alias = GETNAME(file_name, FIND_LENGTH); if (exists(alias) != file_doesnt_exist) { target->stat.is_file = true; target->stat.mode = alias->stat.mode; target->stat.size = alias->stat.size;
*** 322,335 **** /* * Prepare the string where we build the full name of the * files in the directory. */ if ((dir->hash.length > 1) || (wcb.get_string()[0] != (int) period_char)) { ! (void) wscpy(file_name, wcb.get_string()); MBSTOWCS(wcs_buffer, "/"); ! (void) wscat(file_name, wcs_buffer); ! file_name_p = file_name + wslen(file_name); } /* Open the directory. */ vpath_loop: dir_fd = opendir(dir->string_mb); --- 322,335 ---- /* * Prepare the string where we build the full name of the * files in the directory. */ if ((dir->hash.length > 1) || (wcb.get_string()[0] != (int) period_char)) { ! (void) wcscpy(file_name, wcb.get_string()); MBSTOWCS(wcs_buffer, "/"); ! (void) wcscat(file_name, wcs_buffer); ! file_name_p = file_name + wcslen(file_name); } /* Open the directory. */ vpath_loop: dir_fd = opendir(dir->string_mb);
*** 350,360 **** /* * Build the full name of the file using whatever * path supplied to the function. */ MBSTOWCS(tmp_wcs_buffer, dp->d_name); ! (void) wscpy(file_name_p, tmp_wcs_buffer); file = enter_file_name(file_name, library); if ((pattern != NULL) && amatch(tmp_wcs_buffer, pattern)) { /* * If we are expanding a wildcard pattern, we * enter the file as a dependency for the target. --- 350,360 ---- /* * Build the full name of the file using whatever * path supplied to the function. */ MBSTOWCS(tmp_wcs_buffer, dp->d_name); ! (void) wcscpy(file_name_p, tmp_wcs_buffer); file = enter_file_name(file_name, library); if ((pattern != NULL) && amatch(tmp_wcs_buffer, pattern)) { /* * If we are expanding a wildcard pattern, we * enter the file as a dependency for the target.
*** 381,391 **** if ((dp->d_name[0] == 's') && (dp->d_name[1] == (int) period_char)) { MBSTOWCS(tmp_wcs_buffer, dp->d_name + 2); plain_file_name_p = plain_file_name; ! (void) wscpy(plain_file_name_p, tmp_wcs_buffer); plain_file = GETNAME(plain_file_name, FIND_LENGTH); plain_file->stat.is_file = true; plain_file->stat.has_sccs = HAS_SCCS; /* * Enter the s. file as a dependency for the --- 381,391 ---- if ((dp->d_name[0] == 's') && (dp->d_name[1] == (int) period_char)) { MBSTOWCS(tmp_wcs_buffer, dp->d_name + 2); plain_file_name_p = plain_file_name; ! (void) wcscpy(plain_file_name_p, tmp_wcs_buffer); plain_file = GETNAME(plain_file_name, FIND_LENGTH); plain_file->stat.is_file = true; plain_file->stat.has_sccs = HAS_SCCS; /* * Enter the s. file as a dependency for the
*** 434,448 **** * Now read the SCCS directory. * Files in the SCSC directory are considered to be part of the set of * files in the plain directory. They are also entered in their own right. * Prepare the string where we build the true name of the SCCS files. */ ! (void) wsncpy(plain_file_name, file_name, file_name_p - file_name); plain_file_name[file_name_p - file_name] = 0; ! plain_file_name_p = plain_file_name + wslen(plain_file_name); if(!svr4) { if (sccs_dir_path != NULL) { wchar_t tmp_wchar; --- 434,448 ---- * Now read the SCCS directory. * Files in the SCSC directory are considered to be part of the set of * files in the plain directory. They are also entered in their own right. * Prepare the string where we build the true name of the SCCS files. */ ! (void) wcsncpy(plain_file_name, file_name, file_name_p - file_name); plain_file_name[file_name_p - file_name] = 0; ! plain_file_name_p = plain_file_name + wcslen(plain_file_name); if(!svr4) { if (sccs_dir_path != NULL) { wchar_t tmp_wchar;
*** 459,476 **** *file_name_p = tmp_wchar; } else { (void) sprintf(mb_path, "%s/SCCS", sccs_dir_path); } MBSTOWCS(path, mb_path); ! (void) wscpy(file_name, path); } else { MBSTOWCS(wcs_buffer, "SCCS"); ! (void) wscpy(file_name_p, wcs_buffer); } } else { MBSTOWCS(wcs_buffer, "."); ! (void) wscpy(file_name_p, wcs_buffer); } /* Internalize the constructed SCCS dir name. */ (void) exists(dir = GETNAME(file_name, FIND_LENGTH)); /* Just give up if the directory file doesnt exist. */ if (!dir->stat.is_file) { --- 459,476 ---- *file_name_p = tmp_wchar; } else { (void) sprintf(mb_path, "%s/SCCS", sccs_dir_path); } MBSTOWCS(path, mb_path); ! (void) wcscpy(file_name, path); } else { MBSTOWCS(wcs_buffer, "SCCS"); ! (void) wcscpy(file_name_p, wcs_buffer); } } else { MBSTOWCS(wcs_buffer, "."); ! (void) wcscpy(file_name_p, wcs_buffer); } /* Internalize the constructed SCCS dir name. */ (void) exists(dir = GETNAME(file_name, FIND_LENGTH)); /* Just give up if the directory file doesnt exist. */ if (!dir->stat.is_file) {
*** 480,491 **** dir_fd = opendir(dir->string_mb); if (dir_fd == NULL) { return result; } MBSTOWCS(wcs_buffer, "/"); ! (void) wscat(file_name, wcs_buffer); ! file_name_p = file_name + wslen(file_name); while ((dp = readdir(dir_fd)) != NULL) { if ((dp->d_fileno == 0) || ((dp->d_name[0] == (int) period_char) && ((dp->d_name[1] == 0) || --- 480,491 ---- dir_fd = opendir(dir->string_mb); if (dir_fd == NULL) { return result; } MBSTOWCS(wcs_buffer, "/"); ! (void) wcscat(file_name, wcs_buffer); ! file_name_p = file_name + wcslen(file_name); while ((dp = readdir(dir_fd)) != NULL) { if ((dp->d_fileno == 0) || ((dp->d_name[0] == (int) period_char) && ((dp->d_name[1] == 0) ||
*** 493,503 **** (dp->d_name[2] == 0))))) { continue; } /* Construct and internalize the true name of the SCCS file. */ MBSTOWCS(wcs_buffer, dp->d_name); ! (void) wscpy(file_name_p, wcs_buffer); file = GETNAME(file_name, FIND_LENGTH); file->stat.is_file = true; file->stat.has_sccs = NO_SCCS; /* * If this is an s. file, we also enter it as if it --- 493,503 ---- (dp->d_name[2] == 0))))) { continue; } /* Construct and internalize the true name of the SCCS file. */ MBSTOWCS(wcs_buffer, dp->d_name); ! (void) wcscpy(file_name_p, wcs_buffer); file = GETNAME(file_name, FIND_LENGTH); file->stat.is_file = true; file->stat.has_sccs = NO_SCCS; /* * If this is an s. file, we also enter it as if it
*** 505,515 **** */ if ((dp->d_name[0] == 's') && (dp->d_name[1] == (int) period_char)) { MBSTOWCS(wcs_buffer, dp->d_name + 2); ! (void) wscpy(plain_file_name_p, wcs_buffer); plain_file = GETNAME(plain_file_name, FIND_LENGTH); plain_file->stat.is_file = true; plain_file->stat.has_sccs = HAS_SCCS; /* if sccs dependency is already set,skip */ if(plain_file->prop) { --- 505,515 ---- */ if ((dp->d_name[0] == 's') && (dp->d_name[1] == (int) period_char)) { MBSTOWCS(wcs_buffer, dp->d_name + 2); ! (void) wcscpy(plain_file_name_p, wcs_buffer); plain_file = GETNAME(plain_file_name, FIND_LENGTH); plain_file->stat.is_file = true; plain_file->stat.has_sccs = HAS_SCCS; /* if sccs dependency is already set,skip */ if(plain_file->prop) {