Skip to content

Commit 962aba3

Browse files
committed
ext/standard/mail.c: Reduce scope of some variable declarations
1 parent c6e1e30 commit 962aba3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/standard/mail.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,7 @@ static int php_mail_detect_multiple_crlf(const char *hdr) {
410410
/* {{{ php_mail */
411411
PHPAPI int php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd)
412412
{
413-
#ifdef PHP_WIN32
414-
int tsm_err;
415-
char *tsm_errmsg = NULL;
416-
#endif
417413
FILE *sendmail;
418-
int ret;
419414
char *sendmail_path = INI_STR("sendmail_path");
420415
char *sendmail_cmd = NULL;
421416
char *mail_log = INI_STR("mail.log");
@@ -491,6 +486,9 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
491486

492487
if (!sendmail_path) {
493488
#ifdef PHP_WIN32
489+
int tsm_err;
490+
char *tsm_errmsg = NULL;
491+
494492
/* handle old style win smtp sending */
495493
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL) == FAILURE) {
496494
if (tsm_errmsg) {
@@ -556,7 +554,7 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
556554
fprintf(sendmail, "%s%s", hdr, line_sep);
557555
}
558556
fprintf(sendmail, "%s%s%s", line_sep, message, line_sep);
559-
ret = pclose(sendmail);
557+
int ret = pclose(sendmail);
560558

561559
#if PHP_SIGCHILD
562560
if (sig_handler) {

0 commit comments

Comments
 (0)