@ -697,12 +697,6 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
tag_args . value = NULL ;
tag_args . contents = NULL ;
if ( dirname ) {
snprintf ( filename , 1024 , " %s " PATHSEP " rfc2397 " , dirname ) ;
if ( mkdir ( filename , 0700 ) & & errno ! = EEXIST ) {
file_buff_o2 = file_buff_text = NULL ;
goto abort ;
}
file_buff_o2 = ( file_buff_t * ) cli_malloc ( sizeof ( file_buff_t ) ) ;
if ( ! file_buff_o2 ) {
cli_errmsg ( " cli_html_normalise: Unable to allocate memory for file_buff_o2 \n " ) ;
@ -1611,6 +1605,8 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
break ;
case HTML_RFC2397_INIT :
if ( dirname ) {
STATBUF statbuf ;
if ( NULL ! = file_tmp_o1 ) {
if ( file_tmp_o1 - > fd ! = - 1 ) {
html_output_flush ( file_tmp_o1 ) ;
@ -1625,7 +1621,16 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
cli_errmsg ( " cli_html_normalise: Unable to allocate memory for file_tmp_o1 \n " ) ;
goto abort ;
}
/* Create rfc2397 directory if it doesn't already exist */
snprintf ( filename , 1024 , " %s " PATHSEP " rfc2397 " , dirname ) ;
if ( LSTAT ( filename , & statbuf ) = = - 1 ) {
if ( mkdir ( filename , 0700 ) & & errno ! = EEXIST ) {
cli_errmsg ( " Failed to create directory: %s \n " , dirname ) ;
goto abort ;
}
}
tmp_file = cli_gentemp ( filename ) ;
if ( ! tmp_file ) {
goto abort ;