comparison lib/config_file.c @ 854:2c94567f9a53

2006-11-16 Brian Masney <masneyb@gftp.org> * lib/config_file.c (write_comment) - added patch that fixes writing the comments to the config file. In some cases, an extra # was placed at the beginning of a line. It could cause some settings to be not processed. (closes #339029) (from Morita Sho <bugreport_01@morita-inc.co.jp>)
author masneyb
date Fri, 17 Nov 2006 02:50:34 +0000
parents d553d14a2565
children 1808cebed602
comparison
equal deleted inserted replaced
853:e30271d47353 854:2c94567f9a53
703 { 703 {
704 for (endpos = pos + 76; *endpos != ' ' && *endpos != '\0'; 704 for (endpos = pos + 76; *endpos != ' ' && *endpos != '\0';
705 endpos++); 705 endpos++);
706 } 706 }
707 fwrite (pos, 1, endpos - pos, fd); 707 fwrite (pos, 1, endpos - pos, fd);
708 fwrite ("\n# ", 1, 3, fd); 708 fwrite ("\n", 1, 1, fd);
709 if (*endpos == '\0') 709 if (*endpos == '\0')
710 { 710 {
711 pos = endpos; 711 pos = endpos;
712 break; 712 break;
713 } 713 }
714 else 714 pos = endpos + 1;
715 pos = endpos + 1; 715 fwrite ("# ", 1, 2, fd);
716 } 716 }
717 if (strlen (pos) > 1) 717 if (strlen (pos) > 1)
718 { 718 {
719 fwrite (pos, 1, strlen (pos), fd); 719 fwrite (pos, 1, strlen (pos), fd);
720 fwrite ("\n", 1, 1, fd); 720 fwrite ("\n", 1, 1, fd);