History

move stuff around and just use Biobuf* everywhere

Sigrid Haflínudóttir committed 6 years ago

Commit ecd40a81 parent 745debc8 files · +82 −64Browse files

Showing the changes to string.c (1 of 8 files). Show all

Unified · Split

string.c+6−6
@@ -62,7 +62,7 @@ pdfstring(Biobuf *b) · 61 unmodified lines
62 return nil;62 return nil;
63 63
64 for(paren = sz = 0;;){64 for(paren = sz = 0;;){
65 if((c = Bgetc(b)) <= 0)65 if((c = Bgetc(b)) < 0)
66 break;66 break;
67 67
68 switch(c){68 switch(c){
@@ -81,7 +81,7 @@ pdfstring(Biobuf *b) · 12 unmodified lines
81 paren--;81 paren--;
82 if(paren < 1){82 if(paren < 1){
83 c = 0;83 c = 0;
84 break;84 goto end;
85 }85 }
86 continue;86 continue;
87 87
@@ -99,7 +99,7 @@ pdfstring(Biobuf *b) · 11 unmodified lines
99 oct[i] = 0;99 oct[i] = 0;
100 c = strtol(oct, nil, 8);100 c = strtol(oct, nil, 8);
101 }else if(c >= nelem(esc) || (c = esc[c]) == 0){101 }else if(c >= nelem(esc) || (c = esc[c]) == 0){
102 werrstr("unknown escape char %c", c);102 werrstr("unknown escape char '%c'", c);
103 goto err;103 goto err;
104 }else if(c < 0){104 }else if(c < 0){
105 continue;105 continue;
@@ -108,13 +108,13 @@ pdfstring(Biobuf *b) · 2 unmodified lines
108 108
109 default:109 default:
110 if(paren < 1){110 if(paren < 1){
111 werrstr("unexpected char '%c'", c);111 werrstr("unexpected char %02x '%c'", (u8int)c, c);
112 goto err;112 goto err;
113 }113 }
114 break;114 break;
115 }115 }
116 116
117 if(c <= 0)117 if(c < 0)
118 break;118 break;
119 if(sz+1 > maxsz){119 if(sz+1 > maxsz){
120 maxsz *= 2;120 maxsz *= 2;
@@ -124,7 +124,7 @@ pdfstring(Biobuf *b) · 3 unmodified lines
124 }124 }
125 s[sz++] = c;125 s[sz++] = c;
126 }126 }
127 127end:
128 if(paren != 0){128 if(paren != 0){
129 werrstr("bad paren");129 werrstr("bad paren");
130 goto err;130 goto err;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t