Commit b9fdc4bdbd03219085227a9b6f7f8ae48839b933

Authored by perry.werneck@gmail.com
1 parent 87cfcc55

Arquivos a transferir devem sempre ser abertos com modo binário no windows

@@ -52,7 +52,7 @@ BINDIR=.bin @@ -52,7 +52,7 @@ BINDIR=.bin
52 EXEEXT=@EXEEXT@ 52 EXEEXT=@EXEEXT@
53 DBGLIB=-L../../$(BINDIR)/Debug@DLLDIR@ -l3270 53 DBGLIB=-L../../$(BINDIR)/Debug@DLLDIR@ -l3270
54 RLSLIB=-L../../$(BINDIR)/Release@DLLDIR@ -l3270 54 RLSLIB=-L../../$(BINDIR)/Release@DLLDIR@ -l3270
55 -TMPDIR=.tmp 55 +TMPDIR ?= .tmp
56 GLOBAL_DEPS=$(PWD)/include/*.h $(PWD)/include/lib3270/*.h 56 GLOBAL_DEPS=$(PWD)/include/*.h $(PWD)/include/lib3270/*.h
57 LANG_FILES=$(wildcard po/*.po) 57 LANG_FILES=$(wildcard po/*.po)
58 58
@@ -116,6 +116,7 @@ po/%.po: $(PACKAGE_NAME).po @@ -116,6 +116,7 @@ po/%.po: $(PACKAGE_NAME).po
116 @cp $@ $(TMPDIR)/$@ 2> $(TMPDIR)/cp.err > $(TMPDIR)/cp.out || true 116 @cp $@ $(TMPDIR)/$@ 2> $(TMPDIR)/cp.err > $(TMPDIR)/cp.out || true
117 @touch $(TMPDIR)/$@ 117 @touch $(TMPDIR)/$@
118 @$(MSGMERGE) $(TMPDIR)/$@ $(PACKAGE_NAME).po --output-file=$@ 118 @$(MSGMERGE) $(TMPDIR)/$@ $(PACKAGE_NAME).po --output-file=$@
  119 + @rm -fr $(TMPDIR)/po
119 120
120 $(BINDIR)/Release/$(localedir)/%/LC_MESSAGES/$(PACKAGE_NAME).mo: po/%.po 121 $(BINDIR)/Release/$(localedir)/%/LC_MESSAGES/$(PACKAGE_NAME).mo: po/%.po
121 @echo " FMT `basename $@`" 122 @echo " FMT `basename $@`"
@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2012-12-26 10:34-0200\n" 8 +"POT-Creation-Date: 2012-12-26 11:20-0200\n"
9 "PO-Revision-Date: 2012-12-26 10:36-0200\n" 9 "PO-Revision-Date: 2012-12-26 10:36-0200\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <>\n" 11 "Language-Team: Português <>\n"
@@ -268,7 +268,7 @@ msgstr &quot;Não posso aceitar elemento %s sem nome&quot; @@ -268,7 +268,7 @@ msgstr &quot;Não posso aceitar elemento %s sem nome&quot;
268 msgid "Can't connect to %s:%d" 268 msgid "Can't connect to %s:%d"
269 msgstr "Não foi possível conectar a %s:%d" 269 msgstr "Não foi possível conectar a %s:%d"
270 270
271 -#: host.c:316 271 +#: host.c:154
272 msgid "Can't connect to host" 272 msgid "Can't connect to host"
273 msgstr "Não foi possível conectar ao servidor" 273 msgstr "Não foi possível conectar ao servidor"
274 274
@@ -281,7 +281,7 @@ msgstr &quot;Não foi possível converter a linha %d de %s para %s&quot; @@ -281,7 +281,7 @@ msgstr &quot;Não foi possível converter a linha %d de %s para %s&quot;
281 msgid "Can't cut rectangular regions" 281 msgid "Can't cut rectangular regions"
282 msgstr "Recortar não permitido em seleção retangular" 282 msgstr "Recortar não permitido em seleção retangular"
283 283
284 -#: ft.c:307 284 +#: ft.c:311
285 msgid "Can't get file size" 285 msgid "Can't get file size"
286 msgstr "Não foi possível obter o tamanho do arquivo" 286 msgstr "Não foi possível obter o tamanho do arquivo"
287 287
@@ -294,7 +294,7 @@ msgstr &quot;Não foi possível carregar %s&quot; @@ -294,7 +294,7 @@ msgstr &quot;Não foi possível carregar %s&quot;
294 msgid "Can't load file" 294 msgid "Can't load file"
295 msgstr "Não foi possível carregar arquivo" 295 msgstr "Não foi possível carregar arquivo"
296 296
297 -#: ft.c:226 297 +#: ft.c:230
298 msgid "Can't open local file" 298 msgid "Can't open local file"
299 msgstr "Não foi possível abrir arquivo local" 299 msgstr "Não foi possível abrir arquivo local"
300 300
@@ -511,15 +511,15 @@ msgstr &quot;EOR recebido fora do modo 3270, ignorado.&quot; @@ -511,15 +511,15 @@ msgstr &quot;EOR recebido fora do modo 3270, ignorado.&quot;
511 msgid "ET_A" 511 msgid "ET_A"
512 msgstr "ET_A" 512 msgstr "ET_A"
513 513
514 -#: host.c:340 514 +#: host.c:178
515 msgid "Empty LU name" 515 msgid "Empty LU name"
516 msgstr "Nome da LU está em branco" 516 msgstr "Nome da LU está em branco"
517 517
518 -#: host.c:267 host.c:394 518 +#: host.c:105 host.c:232
519 msgid "Empty hostname" 519 msgid "Empty hostname"
520 msgstr "Nome do servidor em branco" 520 msgstr "Nome do servidor em branco"
521 521
522 -#: host.c:447 522 +#: host.c:285
523 msgid "Empty port name" 523 msgid "Empty port name"
524 msgstr "Porta em branco" 524 msgstr "Porta em branco"
525 525
@@ -675,7 +675,7 @@ msgstr &quot;HTTP Proxy: Resposta desconhecida&quot; @@ -675,7 +675,7 @@ msgstr &quot;HTTP Proxy: Resposta desconhecida&quot;
675 msgid "Help" 675 msgid "Help"
676 msgstr "Ajuda" 676 msgstr "Ajuda"
677 677
678 -#: ft.c:524 678 +#: ft.c:528
679 msgid "Host disconnected, transfer cancelled" 679 msgid "Host disconnected, transfer cancelled"
680 msgstr "Servidor desconectou, transferência cancelada" 680 msgstr "Servidor desconectou, transferência cancelada"
681 681
@@ -707,8 +707,8 @@ msgstr &quot;Tipo do sistema no servidor&quot; @@ -707,8 +707,8 @@ msgstr &quot;Tipo do sistema no servidor&quot;
707 msgid "Host to connect" 707 msgid "Host to connect"
708 msgstr "Servidor a conectar" 708 msgstr "Servidor a conectar"
709 709
710 -#: host.c:315 host.c:340 host.c:352 host.c:378 host.c:390 host.c:394  
711 -#: host.c:447 host.c:462 710 +#: host.c:153 host.c:178 host.c:190 host.c:216 host.c:228 host.c:232
  711 +#: host.c:285 host.c:300
712 msgid "Hostname syntax error" 712 msgid "Hostname syntax error"
713 msgstr "Formato inválido no nome do servidor" 713 msgstr "Formato inválido no nome do servidor"
714 714
@@ -740,7 +740,7 @@ msgstr &quot;Intensificado/Protegido&quot; @@ -740,7 +740,7 @@ msgstr &quot;Intensificado/Protegido&quot;
740 msgid "Intensified/Unprotected" 740 msgid "Intensified/Unprotected"
741 msgstr "Intensificado/Desprotegido" 741 msgstr "Intensificado/Desprotegido"
742 742
743 -#: host.c:496 743 +#: host.c:334
744 msgid "Invalid (empty) hostname" 744 msgid "Invalid (empty) hostname"
745 msgstr "Nome do host é invalido (vazio)" 745 msgstr "Nome do host é invalido (vazio)"
746 746
@@ -791,7 +791,7 @@ msgstr &quot;Barra lateral&quot; @@ -791,7 +791,7 @@ msgstr &quot;Barra lateral&quot;
791 msgid "Misc colors" 791 msgid "Misc colors"
792 msgstr "Cores diversas" 792 msgstr "Cores diversas"
793 793
794 -#: host.c:390 794 +#: host.c:228
795 msgid "Missing ']'" 795 msgid "Missing ']'"
796 msgstr "Faltando ']'" 796 msgstr "Faltando ']'"
797 797
@@ -812,7 +812,7 @@ msgstr &quot;Monocromático&quot; @@ -812,7 +812,7 @@ msgstr &quot;Monocromático&quot;
812 msgid "Move action needs target & direction attributes" 812 msgid "Move action needs target & direction attributes"
813 msgstr "Ação \"move\" precisa dos atributos \"target\" e \"direction\"" 813 msgstr "Ação \"move\" precisa dos atributos \"target\" e \"direction\""
814 814
815 -#: host.c:462 815 +#: host.c:300
816 msgid "Multiple port names" 816 msgid "Multiple port names"
817 msgstr "Múltiplos nomes de porta" 817 msgstr "Múltiplos nomes de porta"
818 818
@@ -852,7 +852,7 @@ msgstr &quot;Normal/Desprotegido&quot; @@ -852,7 +852,7 @@ msgstr &quot;Normal/Desprotegido&quot;
852 msgid "Not available" 852 msgid "Not available"
853 msgstr "Não disponível" 853 msgstr "Não disponível"
854 854
855 -#: ft.c:531 855 +#: ft.c:535
856 msgid "Not in 3270 mode, transfer cancelled" 856 msgid "Not in 3270 mode, transfer cancelled"
857 msgstr "Não está no modo 3270, transferência cancelada" 857 msgstr "Não está no modo 3270, transferência cancelada"
858 858
@@ -876,7 +876,7 @@ msgstr &quot;Estado inválido na OIA&quot; @@ -876,7 +876,7 @@ msgstr &quot;Estado inválido na OIA&quot;
876 msgid "OIA status ok" 876 msgid "OIA status ok"
877 msgstr "Estado normal na OIA" 877 msgstr "Estado normal na OIA"
878 878
879 -#: host.c:317 879 +#: host.c:155
880 #, c-format 880 #, c-format
881 msgid "Option '%c:' is not supported" 881 msgid "Option '%c:' is not supported"
882 msgstr "Opção não suportada: '%c:'" 882 msgstr "Opção não suportada: '%c:'"
@@ -1342,7 +1342,7 @@ msgstr &quot;Erro de leitura SSL&quot; @@ -1342,7 +1342,7 @@ msgstr &quot;Erro de leitura SSL&quot;
1342 msgid "SSL connect failed!" 1342 msgid "SSL connect failed!"
1343 msgstr "Conexão SSL falhou" 1343 msgstr "Conexão SSL falhou"
1344 1344
1345 -#: host.c:302 1345 +#: host.c:140
1346 msgid "SSL error" 1346 msgid "SSL error"
1347 msgstr "Erro SSL" 1347 msgstr "Erro SSL"
1348 1348
@@ -1491,7 +1491,7 @@ msgstr &quot;Erro ao enviar dados para a rede&quot; @@ -1491,7 +1491,7 @@ msgstr &quot;Erro ao enviar dados para a rede&quot;
1491 msgid "Space allocation units" 1491 msgid "Space allocation units"
1492 msgstr "Space allocation units" 1492 msgstr "Space allocation units"
1493 1493
1494 -#: host.c:352 1494 +#: host.c:190
1495 msgid "Space in LU name" 1495 msgid "Space in LU name"
1496 msgstr "Espaço no nome da LU" 1496 msgstr "Espaço no nome da LU"
1497 1497
@@ -1519,7 +1519,7 @@ msgstr &quot;T_otal&quot; @@ -1519,7 +1519,7 @@ msgstr &quot;T_otal&quot;
1519 msgid "Terminal colors" 1519 msgid "Terminal colors"
1520 msgstr "Cores do terminal" 1520 msgstr "Cores do terminal"
1521 1521
1522 -#: host.c:378 1522 +#: host.c:216
1523 msgid "Text before '['" 1523 msgid "Text before '['"
1524 msgstr "Texto antes de '['" 1524 msgstr "Texto antes de '['"
1525 1525
@@ -1565,7 +1565,7 @@ msgstr &quot;&quot; @@ -1565,7 +1565,7 @@ msgstr &quot;&quot;
1565 msgid "This program requires GTK version %d.%d.%d" 1565 msgid "This program requires GTK version %d.%d.%d"
1566 msgstr "Este programa precisa do GTK versão %d.%d.%d" 1566 msgstr "Este programa precisa do GTK versão %d.%d.%d"
1567 1567
1568 -#: host.c:304 1568 +#: host.c:142
1569 #, c-format 1569 #, c-format
1570 msgid "" 1570 msgid ""
1571 "This version of %s was built without support for secure sockets layer (SSL)." 1571 "This version of %s was built without support for secure sockets layer (SSL)."
@@ -1615,7 +1615,7 @@ msgstr &quot;UTF-8&quot; @@ -1615,7 +1615,7 @@ msgstr &quot;UTF-8&quot;
1615 msgid "Uknown DFT Open type from host" 1615 msgid "Uknown DFT Open type from host"
1616 msgstr "Servidor enviou código de abertura DFT desconhecido" 1616 msgstr "Servidor enviou código de abertura DFT desconhecido"
1617 1617
1618 -#: host.c:303 1618 +#: host.c:141
1619 msgid "Unable to connect to secure hosts" 1619 msgid "Unable to connect to secure hosts"
1620 msgstr "Não é possível conectar em servidores seguros" 1620 msgstr "Não é possível conectar em servidores seguros"
1621 1621
@@ -1623,7 +1623,7 @@ msgstr &quot;Não é possível conectar em servidores seguros&quot; @@ -1623,7 +1623,7 @@ msgstr &quot;Não é possível conectar em servidores seguros&quot;
1623 msgid "Unable to paste text" 1623 msgid "Unable to paste text"
1624 msgstr "Incapaz de colar texto" 1624 msgstr "Incapaz de colar texto"
1625 1625
1626 -#: ft.c:391 1626 +#: ft.c:395
1627 msgid "Unable to send file-transfer request" 1627 msgid "Unable to send file-transfer request"
1628 msgstr "Não foi possível enviar a requisição de transferência de arquivo" 1628 msgstr "Não foi possível enviar a requisição de transferência de arquivo"
1629 1629
@@ -1766,11 +1766,11 @@ msgstr &quot;WSAEventSelect falhou&quot; @@ -1766,11 +1766,11 @@ msgstr &quot;WSAEventSelect falhou&quot;
1766 msgid "WSAStartup failed" 1766 msgid "WSAStartup failed"
1767 msgstr "WSAStartup falhou" 1767 msgstr "WSAStartup falhou"
1768 1768
1769 -#: ft.c:400 1769 +#: ft.c:404
1770 msgid "Waiting for GET response" 1770 msgid "Waiting for GET response"
1771 msgstr "Aguardando resposta do pedido de download" 1771 msgstr "Aguardando resposta do pedido de download"
1772 1772
1773 -#: ft.c:402 1773 +#: ft.c:406
1774 msgid "Waiting for PUT response" 1774 msgid "Waiting for PUT response"
1775 msgstr "Aguardando resposta do pedido de upload" 1775 msgstr "Aguardando resposta do pedido de upload"
1776 1776
src/lib3270/ft.c
@@ -219,7 +219,11 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); @@ -219,7 +219,11 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
219 } 219 }
220 220
221 // Open local file 221 // Open local file
  222 +#ifdef _WIN32
  223 + ft_local_file = fopen(local,(flags & LIB3270_FT_OPTION_RECEIVE) ? ((flags & LIB3270_FT_OPTION_APPEND) ? "ab" : "wb") : "rb");
  224 +#else
222 ft_local_file = fopen(local,(flags & LIB3270_FT_OPTION_RECEIVE) ? ((flags & LIB3270_FT_OPTION_APPEND) ? "a" : "w") : "r"); 225 ft_local_file = fopen(local,(flags & LIB3270_FT_OPTION_RECEIVE) ? ((flags & LIB3270_FT_OPTION_APPEND) ? "a" : "w") : "r");
  226 +#endif // _WIN32
223 227
224 if(!ft_local_file) 228 if(!ft_local_file)
225 { 229 {
src/lib3270/host.c
@@ -60,168 +60,6 @@ @@ -60,168 +60,6 @@
60 static void try_reconnect(H3270 *session); 60 static void try_reconnect(H3270 *session);
61 61
62 /* 62 /*
63 -static char * stoken(char **s)  
64 -{  
65 - char *r;  
66 - char *ss = *s;  
67 -  
68 - if (!*ss)  
69 - return NULL;  
70 - r = ss;  
71 - while (*ss && *ss != ' ' && *ss != '\t')  
72 - ss++;  
73 - if (*ss) {  
74 - *ss++ = '\0';  
75 - while (*ss == ' ' || *ss == '\t')  
76 - ss++;  
77 - }  
78 - *s = ss;  
79 - return r;  
80 -}  
81 -*/  
82 -  
83 -/*  
84 - * Read the host file  
85 - */ /*  
86 -void  
87 -hostfile_init(void)  
88 -{  
89 - FILE *hf;  
90 - char buf[1024];  
91 - static Boolean hostfile_initted = False;  
92 - struct host *h;  
93 - char *hostfile_name;  
94 -  
95 - if (hostfile_initted)  
96 - return;  
97 -  
98 - hostfile_initted = True;  
99 - hostfile_name = appres.hostsfile;  
100 - if (hostfile_name == CN)  
101 - hostfile_name = xs_buffer("%s/ibm_hosts", appres.conf_dir);  
102 - else  
103 - hostfile_name = do_subst(appres.hostsfile, True, True);  
104 - hf = fopen(hostfile_name, "r");  
105 - if (hf != (FILE *)NULL) {  
106 - while (fgets(buf, sizeof(buf), hf)) {  
107 - char *s = buf;  
108 - char *name, *entry_type, *hostname;  
109 - char *slash;  
110 -  
111 - if (strlen(buf) > (unsigned)1 &&  
112 - buf[strlen(buf) - 1] == '\n') {  
113 - buf[strlen(buf) - 1] = '\0';  
114 - }  
115 - while (isspace(*s))  
116 - s++;  
117 - if (!*s || *s == '#')  
118 - continue;  
119 - name = stoken(&s);  
120 - entry_type = stoken(&s);  
121 - hostname = stoken(&s);  
122 - if (!name || !entry_type || !hostname) {  
123 - popup_an_error("Bad %s syntax, entry skipped",  
124 - ResHostsFile);  
125 - continue;  
126 - }  
127 - h = (struct host *)lib3270_malloc(sizeof(*h));  
128 - if (!split_hier(NewString(name), &h->name,  
129 - &h->parents)) {  
130 - lib3270_free(h);  
131 - continue;  
132 - }  
133 - h->hostname = NewString(hostname);  
134 -  
135 - //  
136 - // Quick syntax extension to allow the hosts file to  
137 - // specify a port as host/port.  
138 - //  
139 - if ((slash = strchr(h->hostname, '/')))  
140 - *slash = ':';  
141 -  
142 - if (!strcmp(entry_type, "primary"))  
143 - h->entry_type = PRIMARY;  
144 - else  
145 - h->entry_type = ALIAS;  
146 - if (*s)  
147 - h->loginstring = NewString(s);  
148 - else  
149 - h->loginstring = CN;  
150 - h->prev = last_host;  
151 - h->next = (struct host *)NULL;  
152 - if (last_host)  
153 - last_host->next = h;  
154 - else  
155 - hosts = h;  
156 - last_host = h;  
157 - }  
158 - (void) fclose(hf);  
159 - } else if (appres.hostsfile != CN) {  
160 - popup_an_errno(errno, "Cannot open " ResHostsFile " '%s'",  
161 - appres.hostsfile);  
162 - }  
163 - lib3270_free(hostfile_name);  
164 -  
165 -// #if defined(X3270_DISPLAY)  
166 -// save_recent(CN);  
167 -// #endif  
168 -}  
169 -*/  
170 -  
171 -/*  
172 - * Look up a host in the list. Turns aliases into real hostnames, and  
173 - * finds loginstrings.  
174 - */ /*  
175 -static int  
176 -hostfile_lookup(const char *name, char **hostname, char **loginstring)  
177 -{  
178 - struct host *h;  
179 -  
180 - hostfile_init();  
181 - for (h = hosts; h != (struct host *)NULL; h = h->next) {  
182 - if (h->entry_type == RECENT)  
183 - continue;  
184 - if (!strcmp(name, h->name)) {  
185 - *hostname = h->hostname;  
186 - if (h->loginstring != CN) {  
187 - *loginstring = h->loginstring;  
188 - } else {  
189 - *loginstring = appres.login_macro;  
190 - }  
191 - return 1;  
192 - }  
193 - }  
194 - return 0;  
195 -}  
196 -*/  
197 -  
198 -/*  
199 -#if defined(LOCAL_PROCESS)  
200 -// Recognize and translate "-e" options.  
201 -static const char *  
202 -parse_localprocess(const char *s)  
203 -{  
204 - int sl = strlen(OptLocalProcess);  
205 -  
206 - if (!strncmp(s, OptLocalProcess, sl)) {  
207 - if (s[sl] == ' ')  
208 - return(s + sl + 1);  
209 - else if (s[sl] == '\0') {  
210 - char *r;  
211 -  
212 - r = getenv("SHELL");  
213 - if (r != CN)  
214 - return r;  
215 - else  
216 - return "/bin/sh";  
217 - }  
218 - }  
219 - return CN;  
220 -}  
221 -#endif  
222 -*/  
223 -  
224 -/*  
225 * Strip qualifiers from a hostname. 63 * Strip qualifiers from a hostname.
226 * Returns the hostname part in a newly-malloc'd string. 64 * Returns the hostname part in a newly-malloc'd string.
227 * 'needed' is returned True if anything was actually stripped. 65 * 'needed' is returned True if anything was actually stripped.