source:
patches/procps-3.2.7-i18n-1.patch@
7c6ada9
Last change on this file since 7c6ada9 was 702b89c, checked in by , 16 years ago | |
---|---|
|
|
File size: 4.5 KB |
-
procps-3.2.7
Submitted By: Jim Gifford <jim at cross-lfs dot org> Date: 2009-01-11 Initial Package Version: 3.2.7 Upstream Status: Unkown Origin: Fedora Description: i18n Updates diff -Naur procps-3.2.7.orig/Makefile procps-3.2.7/Makefile
old new 67 67 # plus the top-level Makefile to make it work stand-alone. 68 68 _TARFILES := Makefile 69 69 70 CURSES := -lncurses 70 CURSES := -lncursesw 71 71 72 72 # This seems about right for the dynamic library stuff. 73 73 # Something like this is probably needed to make the SE Linux -
procps-3.2.7
diff -Naur procps-3.2.7.orig/sysctl.c procps-3.2.7/sysctl.c
old new 135 135 } 136 136 137 137 /* used to open the file */ 138 tmpname = malloc(strlen(name)+strlen(PROC_PATH)+ 1);138 tmpname = malloc(strlen(name)+strlen(PROC_PATH)+2); 139 139 strcpy(tmpname, PROC_PATH); 140 140 strcat(tmpname, name); 141 141 slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */ -
procps-3.2.7
diff -Naur procps-3.2.7.orig/top.c procps-3.2.7/top.c
old new 2462 2462 int i; 2463 2463 2464 2464 for (i = 0; i < GROUPSMAX; i++) { 2465 win_names(&Winstk[i], Winstk[i].rc.winname); 2465 /* Please, never use something like sprintf(x, "%s", x); ... see win_names() */ 2466 char buf[WINNAMSIZ]; 2467 strncpy(buf, Winstk[i].rc.winname, WINNAMSIZ); 2468 win_names(&Winstk[i], buf); 2466 2469 capsmk(&Winstk[i]); 2467 2470 } 2468 2471 // rely on this next guy to force a call (eventually) to reframewins -
procps-3.2.7
diff -Naur procps-3.2.7.orig/watch.c procps-3.2.7/watch.c
old new 19 19 #include <stdio.h> 20 20 #include <stdlib.h> 21 21 #include <string.h> 22 #include <wchar.h> 23 #include <wctype.h> 22 24 #include <sys/ioctl.h> 23 25 #include <time.h> 24 26 #include <unistd.h> … … 134 136 } 135 137 } 136 138 139 static wint_t 140 readwc(FILE *stream, mbstate_t *mbs) 141 { 142 for (;;) { 143 int chr; 144 char c; 145 wchar_t wc; 146 size_t len; 147 148 chr = getc(stream); 149 if (chr == EOF) 150 return WEOF; 151 c = chr; 152 len = mbrtowc(&wc, &c, 1, mbs); 153 if (len == (size_t)-1) 154 memset(mbs, 0, sizeof(*mbs)); 155 else if (len != (size_t)-2) 156 return wc; 157 } 158 } 159 137 160 int 138 161 main(int argc, char *argv[]) 139 162 { … … 239 262 FILE *p; 240 263 int x, y; 241 264 int oldeolseen = 1; 265 mbstate_t mbs; 242 266 243 267 if (screen_size_changed) { 244 268 get_terminal_size(); … … 266 290 do_exit(2); 267 291 } 268 292 293 memset(&mbs, 0, sizeof(mbs)); 269 294 for (y = show_title; y < height; y++) { 270 295 int eolseen = 0, tabpending = 0; 271 296 for (x = 0; x < width; x++) { 272 int c = ' '; 273 int attr = 0; 297 wint_t c = L' '; 298 int attr = 0, c_width; 299 cchar_t cc; 300 wchar_t wstr[2]; 274 301 275 302 if (!eolseen) { 276 303 /* if there is a tab pending, just spit spaces until the 277 304 next stop instead of reading characters */ 278 305 if (!tabpending) 279 306 do 280 c = getc(p);281 while (c != EOF && !isprint(c)282 && c != '\n'283 && c != '\t');284 if (c == '\n')307 c = readwc(p, &mbs); 308 while (c != WEOF && !iswprint(c) 309 && c != L'\n' 310 && c != L'\t'); 311 if (c == L'\n') 285 312 if (!oldeolseen && x == 0) { 286 313 x = -1; 287 314 continue; 288 315 } else 289 316 eolseen = 1; 290 else if (c == '\t')317 else if (c == L'\t') 291 318 tabpending = 1; 292 if (c == EOF || c == '\n' || c =='\t')293 c = ' ';319 if (c == WEOF || c == L'\n' || c == L'\t') 320 c = L' '; 294 321 if (tabpending && (((x + 1) % 8) == 0)) 295 322 tabpending = 0; 296 323 } 324 wstr[0] = c; 325 wstr[1] = 0; 326 setcchar (&cc, wstr, 0, 0, NULL); 297 327 move(y, x); 298 328 if (option_differences) { 299 int oldch = inch(); 300 char oldc = oldch & A_CHARTEXT; 329 cchar_t oldc; 330 wchar_t oldwstr[2]; 331 attr_t attrs; 332 short colors; 333 334 in_wch(&oldc); 335 getcchar(&oldc, oldwstr, &attrs, &colors, NULL); 301 336 attr = !first_screen 302 && ( c != oldc337 && (wstr[0] != oldwstr[0] 303 338 || 304 339 (option_differences_cumulative 305 && (oldch & A_ATTRIBUTES)));340 && attrs)); 306 341 } 307 342 if (attr) 308 343 standout(); 309 add ch(c);344 add_wch(&cc); 310 345 if (attr) 311 346 standend(); 347 c_width = wcwidth(c); 348 if (c_width > 1) 349 x += c_width - 1; 312 350 } 313 351 oldeolseen = eolseen; 314 352 }
Note:
See TracBrowser
for help on using the repository browser.