Commit 1a1e8112973d5ada9af132185af3eb4501695451

Authored by Perry Werneck
1 parent 5d70e80b

Debugging the new set_field method.

src/core/keyboard/kybd.c
... ... @@ -1666,6 +1666,7 @@ int lib3270_get_field_end(H3270 *hSession, int baddr)
1666 1666 if (hSession->ea_buf[baddr].fa)
1667 1667 baddr = last_nonblank;
1668 1668 }
  1669 +
1669 1670 return baddr;
1670 1671 }
1671 1672  
... ...
src/core/paste.c
... ... @@ -323,7 +323,7 @@ LIB3270_EXPORT int lib3270_set_field(H3270 *hSession, const char *text, int leng
323 323 lib3270_unselect(hSession);
324 324  
325 325 hSession->cbk.suspend(hSession);
326   - hSession->cursor_addr = addr;
  326 + hSession->cursor_addr = ++addr;
327 327 numchars = set_string(hSession, (const unsigned char *) text, length);
328 328 hSession->cbk.resume(hSession);
329 329  
... ...
src/testprogram/testprogram.c
... ... @@ -110,9 +110,24 @@ int main(int argc, char *argv[])
110 110 lib3270_enter(h);
111 111 lib3270_wait(h,5);
112 112  
113   - lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,'\n');
114   - if(text)
115   - printf("Screen:\n[%s]\n",text);
  113 + {
  114 + lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,'\n');
  115 + if(text)
  116 + printf("Screen:\n[%s]\n",text);
  117 +
  118 + lib3270_wait(h,2);
  119 +
  120 + }
  121 +
  122 + {
  123 + printf("\n\nSet field exits with %d\n",lib3270_set_field(h,"aaa",-1));
  124 + printf("\n\nSet field exits with %d\n",lib3270_set_field(h,"bbb",-1));
  125 + printf("\n\nSet field exits with %d\n",lib3270_set_field(h,"ccc",-1));
  126 +
  127 + lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,'\n');
  128 + if(text)
  129 + printf("Screen:\n[%s]\n",text);
  130 + }
116 131  
117 132 }
118 133  
... ...