Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 503 → Rev 504

/trunk/CHANGELOG.md
4,7 → 4,8
- Fixed theoretical bug that can crash a Photoshop application if PLUGIN.DLL exists but is not loaded.
- Added translation for German systems (*)
- `map(i,n)` now works like in Filter Factory and not like GIMP User Filter v0.8.
- `val(i,a,b)` now returns the same value like Filter Factory for illegal values of i.
- `val(i,a,b)` now returns the same value like Filter Factory for illegal values of `i`.
- Standalone filters containing a `&` in Name or Category now have the correct "Visual Themes", as the Manifest XML is not broken anymore.
 
(*) This bug/solution was tested on Windows but needs to be verified and/or implemented on Mac.
 
/trunk/make_win.c
59,30 → 59,58
}
*/
 
int WriteXmlEscaped(char* description, char c) {
int idescription = 0;
if (c == '&') {
description[idescription++] = '&';
description[idescription++] = 'a';
description[idescription++] = 'm';
description[idescription++] = 'p';
description[idescription++] = ';';
}
else if (c == '<') {
description[idescription++] = '&';
description[idescription++] = 'l';
description[idescription++] = 't';
description[idescription++] = ';';
}
else if (c == '>') {
description[idescription++] = '&';
description[idescription++] = 'g';
description[idescription++] = 't';
description[idescription++] = ';';
}
else {
description[idescription++] = c;
}
return idescription;
}
 
int domanifest(char *newmanifest, char *manifestp, PARM_T* pparm, int bits) {
char name[1024] = { 0 };
char description[1024] = { 0 };
char* name;
char* description, *tmpDescription;
int res;
size_t i;
size_t iname = 0;
int idescription = 0;
size_t iname;
 
name = (char*)malloc(40 + (2 * 256) * 5);
description = (char*)malloc(10 + (2 * 256)); // x4 because & becomes &amp;
if (name == NULL || description == NULL) return 0;
// Description
tmpDescription = description;
for (i = 0; i < strlen(pparm->szCategory); i++) {
char c = pparm->szCategory[i];
if ((c != '<') && (c != '>')) {
description[idescription++] = c;
tmpDescription += WriteXmlEscaped(tmpDescription, c);
}
}
description[idescription++] = ' ';
description[idescription++] = '-';
description[idescription++] = ' ';
tmpDescription += WriteXmlEscaped(tmpDescription, ' ');
tmpDescription += WriteXmlEscaped(tmpDescription, '-');
tmpDescription += WriteXmlEscaped(tmpDescription, ' ');
for (i = 0; i < strlen(pparm->szTitle); i++) {
char c = pparm->szTitle[i];
if ((c != '<') && (c != '>')) {
description[idescription++] = c;
tmpDescription += WriteXmlEscaped(tmpDescription, c);
}
}
description[idescription++] = '\0';
tmpDescription[0] = '\0';
 
// Name
strcpy(name, "Telegraphics.FilterFoundry.");
103,11 → 131,16
name[iname++] = '\0';
 
if (bits == 64) {
return sprintf(newmanifest, manifestp, (char*)name, "amd64", VERSION_STR, (char*)description);
res = sprintf(newmanifest, manifestp, (char*)name, "amd64", VERSION_STR, (char*)description);
}
else {
return sprintf(newmanifest, manifestp, (char*)name, "x86", VERSION_STR, (char*)description);
res = sprintf(newmanifest, manifestp, (char*)name, "x86", VERSION_STR, (char*)description);
}
 
free(name);
free(description);
 
return res;
}
 
ULONG changeVersionInfo(FSSpec* dst, HANDLE hUpdate, PARM_T* pparm, int bits) {