Mercurial > dwindows
comparison compat.c @ 73:2f339dd13496
Added C/C++ style escape sequence processing. And fixed a couple OS/2 and
Windows bugs.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 18 Feb 2002 08:43:34 +0000 |
parents | ab77a22a2a36 |
children | f794f2baabf2 |
comparison
equal
deleted
inserted
replaced
72:ab77a22a2a36 | 73:2f339dd13496 |
---|---|
804 } | 804 } |
805 else if(current > -1 && current < count) | 805 else if(current > -1 && current < count) |
806 { | 806 { |
807 /* Use defaults on blank lines */ | 807 /* Use defaults on blank lines */ |
808 if(text[0]) | 808 if(text[0]) |
809 locale_text[current] = strdup(text); | 809 { |
810 int x = 0, z, len = strlen(text); | |
811 | |
812 locale_text[current] = calloc(1, len + 1); | |
813 | |
814 for(z=0;z<len;z++) | |
815 { | |
816 if(text[z] == '\\' && (text[z+1] == 'r' || text[z+1] == 'n' | |
817 || text[z+1] == '\"' || text[z+1] == '\'')) | |
818 { | |
819 switch(text[z+1]) | |
820 { | |
821 case 'r': | |
822 locale_text[current][x] = '\r'; | |
823 break; | |
824 case 'n': | |
825 locale_text[current][x] = '\n'; | |
826 break; | |
827 case '\"': | |
828 locale_text[current][x] = '\"'; | |
829 break; | |
830 case '\'': | |
831 locale_text[current][x] = '\''; | |
832 break; | |
833 } | |
834 x++; | |
835 z++; | |
836 } | |
837 else | |
838 { | |
839 locale_text[current][x] = text[z]; | |
840 x++; | |
841 } | |
842 } | |
843 } | |
810 current++; | 844 current++; |
811 } | 845 } |
812 } | 846 } |
813 } | 847 } |
814 fclose(fp); | 848 fclose(fp); |