| | 165 | === What is the purpose of quoting functions? === |
| | 166 | |
| | 167 | Its purpose is to replace repeated occurances of code of the form |
| | 168 | |
| | 169 | |
| | 170 | {{{ |
| | 171 | sprintf(cl, "%s %s%s%s", dcd->info->delete, |
| | 172 | (needs_quoting(dcd->arcname)) ? "\"" : NullStr, |
| | 173 | dcd->arcname, |
| | 174 | (needs_quoting(dcd->arcname)) ? "\"" : NullStr); |
| | 175 | }}} |
| | 176 | |
| | 177 | |
| | 178 | and possibly |
| | 179 | |
| | 180 | |
| | 181 | {{{ |
| | 182 | runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED, |
| | 183 | hwnd, NULL, NULL, "%s %s%s%s", ad->info->test, |
| | 184 | needs_quoting(ad->arcname) ? "\"" : NullStr, |
| | 185 | ad->arcname, |
| | 186 | needs_quoting(ad->arcname) ? "\"" : NullStr); |
| | 187 | }}} |
| | 188 | |
| | 189 | |
| | 190 | === Where is the best place to do a check for? === |
| | 191 | |
| | 192 | Since the check always needs to be done, it's generally better to do it in |
| | 193 | the function. |
| | 194 | |