ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/map.C
(Generate patch)

Comparing deliantra/server/common/map.C (file contents):
Revision 1.35 by root, Sun Dec 10 01:16:27 2006 UTC vs.
Revision 1.36 by root, Mon Dec 11 02:41:25 2006 UTC

860 860
861 while (fgets (buf, HUGE_BUF, fp) != NULL) 861 while (fgets (buf, HUGE_BUF, fp) != NULL)
862 { 862 {
863 buf[HUGE_BUF - 1] = 0; 863 buf[HUGE_BUF - 1] = 0;
864 key = buf; 864 key = buf;
865
865 while (isspace (*key)) 866 while (isspace (*key))
866 key++; 867 key++;
868
867 if (*key == 0) 869 if (*key == 0)
868 continue; /* empty line */ 870 continue; /* empty line */
871
869 value = strchr (key, ' '); 872 value = strchr (key, ' ');
873
870 if (!value) 874 if (!value)
871 { 875 {
872 end = strchr (key, '\n'); 876 if (end = strchr (key, '\n'))
873 if (end != NULL)
874 {
875 *end = 0; 877 *end = 0;
876 }
877 } 878 }
878 else 879 else
879 { 880 {
880 *value = 0; 881 *value = 0;
881 value++; 882 value++;
882 end = strchr (value, '\n'); 883 end = strchr (value, '\n');
884
883 while (isspace (*value)) 885 while (isspace (*value))
884 { 886 {
885 value++; 887 value++;
888
886 if (*value == '\0' || value == end) 889 if (*value == '\0' || value == end)
887 { 890 {
888 /* Nothing but spaces. */ 891 /* Nothing but spaces. */
889 value = NULL; 892 value = NULL;
890 break; 893 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines