add "%%" escape
This commit is contained in:
parent
44b4830ceb
commit
dd35d6ffc7
2
TODO
2
TODO
@ -1,5 +1,3 @@
|
||||
- vips_system needs to use "%%" for a % character, for compatibility with
|
||||
vips 7.38
|
||||
|
||||
- can we use postbuild elsewhere? look at use of "preclose" / "written", etc.
|
||||
|
||||
|
@ -119,6 +119,7 @@ vips_system_build( VipsObject *object )
|
||||
char line[VIPS_PATH_MAX];
|
||||
char txt[VIPS_PATH_MAX];
|
||||
VipsBuf buf = VIPS_BUF_STATIC( txt );
|
||||
char *p;
|
||||
int result;
|
||||
|
||||
if( VIPS_OBJECT_CLASS( vips_system_parent_class )->build( object ) )
|
||||
@ -164,6 +165,15 @@ vips_system_build( VipsObject *object )
|
||||
cmd, VIPS_PATH_MAX, system->out_name ) )
|
||||
return( -1 );
|
||||
|
||||
/* Swap all "%%" in the string for a single "%". We need this for
|
||||
* compatibility with older printf-based vips_system()s which
|
||||
* needed a double %%.
|
||||
*/
|
||||
for( p = cmd; *p; p++ )
|
||||
if( p[0] == '%' &&
|
||||
p[1] == '%' )
|
||||
memmove( p, p + 1, strlen( p ) );
|
||||
|
||||
if( !(fp = vips_popenf( "%s", "r", cmd )) )
|
||||
return( -1 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user