Posted to tcl by Emiliano at Thu Jul 12 12:27:36 GMT 2012view raw

  1. Index: generic/tkListbox.c
  2. ===================================================================
  3. --- generic/tkListbox.c
  4. +++ generic/tkListbox.c
  5. @@ -699,11 +699,11 @@
  6. }
  7. break;
  8. }
  9.  
  10. case COMMAND_CURSELECTION: {
  11. - char indexStringRep[TCL_INTEGER_SPACE];
  12. + Tcl_Obj *resultObj;
  13. int i;
  14.  
  15. if (objc != 2) {
  16. Tcl_WrongNumArgs(interp, 2, objv, NULL);
  17. result = TCL_ERROR;
  18. @@ -715,17 +715,17 @@
  19. * search functions (Tcl_FirstHashEntry, Tcl_NextHashEntry), but then
  20. * the result wouldn't be in sorted order. So instead we loop through
  21. * the indices in order, adding them to the result if they are
  22. * selected.
  23. */
  24. -
  25. + resultObj = Tcl_NewListObj(0, NULL);
  26. for (i = 0; i < listPtr->nElements; i++) {
  27. if (Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i))) {
  28. - sprintf(indexStringRep, "%d", i);
  29. - Tcl_AppendElement(interp, indexStringRep);
  30. + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewIntObj(i));
  31. }
  32. }
  33. + Tcl_SetObjResult(interp, resultObj);
  34. result = TCL_OK;
  35. break;
  36. }
  37.  
  38. case COMMAND_DELETE: {
  39.  
  40.