Mercurial > gftp.yaz
comparison src/text/gftp-text.c @ 166:a4bf947e9e22
2003-5-27 Brian Masney <masneyb@gftp.org>
* Makefile.am configure.in autogen.sh - build fixes
* src/text/gftp-text.c - if the protocol we are connecting to
doesn't need a username/password, don't prompt the user for one
author | masneyb |
---|---|
date | Tue, 27 May 2003 18:03:20 +0000 |
parents | 5c952c5cb438 |
children | d40f9db52cdf |
comparison
equal
deleted
inserted
replaced
165:e2d4dd07fadd | 166:a4bf947e9e22 |
---|---|
335 return (1); | 335 return (1); |
336 } | 336 } |
337 | 337 |
338 if (request->username == NULL) | 338 if (request->username == NULL) |
339 { | 339 { |
340 if ((pos = gftp_text_ask_question ("Username [anonymous]", 1, tempstr, | 340 if (request->need_userpass) |
341 sizeof (tempstr))) != NULL) | 341 { |
342 { | 342 if ((pos = gftp_text_ask_question ("Username [anonymous]", 1, tempstr, |
343 gftp_set_username (request, pos); | 343 sizeof (tempstr))) != NULL) |
344 if (request->password) | |
345 { | 344 { |
346 g_free (request->password); | 345 gftp_set_username (request, pos); |
347 request->password = NULL; | 346 if (request->password) |
347 { | |
348 g_free (request->password); | |
349 request->password = NULL; | |
350 } | |
348 } | 351 } |
352 else | |
353 gftp_set_username (request, "anonymous"); | |
354 | |
355 if (strcmp (request->username, "anonymous") != 0 && | |
356 (request->password == NULL || *request->password == '\0')) | |
357 { | |
358 if ((pos = gftp_text_ask_question ("Password", 0, tempstr, | |
359 sizeof (tempstr))) == NULL) | |
360 return (1); | |
361 gftp_set_password (request, pos); | |
362 } | |
349 } | 363 } |
350 else | 364 else |
351 gftp_set_username (request, "anonymous"); | 365 { |
352 } | 366 request->username = g_strdup (""); |
353 | 367 if (request->password != NULL) |
354 if (strcmp (request->username, "anonymous") != 0 && | 368 g_free (request->password); |
355 (request->password == NULL || *request->password == '\0')) | 369 request->password = g_strdup (""); |
356 { | 370 } |
357 if ((pos = gftp_text_ask_question ("Password", 0, tempstr, | 371 } |
358 sizeof (tempstr))) == NULL) | 372 |
359 return (1); | |
360 gftp_set_password (request, pos); | |
361 } | |
362 | 373 |
363 gftp_connect (request); | 374 gftp_connect (request); |
364 return (1); | 375 return (1); |
365 } | 376 } |
366 | 377 |