Skip to content

Commit f6b6ed7

Browse files
committed
fix plot save and save error
save errors were not being shown saving a plot didn't expand env vars
1 parent b6382b1 commit f6b6ed7

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ EXTRA_DIST = \
99
bootstrap.sh \
1010
doc \
1111
proj \
12-
acinclude.m4 \
12+
m4 \
1313
nip2.desktop.in \
1414
nip2.xml
1515

src/boxes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ box_alert( GtkWidget *par )
142142
{
143143
char buf[MAX_DIALOG_TEXT];
144144

145-
if( !main_option_batch ) {
145+
if( main_option_batch ) {
146146
/* No X, just print.
147147
*/
148148
fprintf( stderr, "%s\n", error_get_top() );

src/conversion.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ im_lintrauc( double a, IMAGE *in, double b, IMAGE *out )
467467
{
468468
LintraInfo *inf;
469469

470-
/* Check args.
471-
*/
472470
if( in->Coding != IM_CODING_NONE ) {
473471
im_error( "im_lintrauc", _( "not uncoded" ) );
474472
return( -1 );
@@ -479,17 +477,13 @@ im_lintrauc( double a, IMAGE *in, double b, IMAGE *out )
479477
out->Bbits = IM_BBITS_BYTE;
480478
out->BandFmt = IM_BANDFMT_UCHAR;
481479

482-
/* Make space for a little buffer.
483-
*/
484480
if( !(inf = IM_NEW( out, LintraInfo )) )
485481
return( -1 );
486482
inf->a = a;
487483
inf->b = b;
488484
inf->in = in;
489485
inf->out = out;
490486

491-
/* Generate!
492-
*/
493487
if( im_wrapone( in, out,
494488
(im_wrapone_fn) lintrauc_gen, in, inf ) )
495489
return( -1 );
@@ -702,8 +696,9 @@ conversion_make_repaint( Conversion *conv, IMAGE *in )
702696
(conv->scale != 1.0 || conv->offset != 0.0) ) {
703697
IMAGE *t = im_open_local( out, "conv:1", "p" );
704698

705-
if( !t || im_lintrauc( conv->scale, in,
706-
conv->offset, t ) ) {
699+
if( !t ||
700+
im_lintrauc( conv->scale, in,
701+
conv->offset, t ) ) {
707702
im_close( out );
708703
return( NULL );
709704
}

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ main( int argc, char *argv[] )
14651465
}
14661466
}
14671467

1468-
/* Abandon batch mode if there are startup errors.
1468+
/* In batch mode give up if there are startup errors.
14691469
*/
14701470
if( main_option_batch ) {
14711471
if( !main_log_is_empty() ) {

src/plot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ plot_graphic_save( Classmodel *classmodel,
432432
{
433433
Plot *plot = PLOT( classmodel );
434434
ImageValue *value = &plot->value;
435-
char buf[MAX_STRSIZE];
435+
char buf[FILENAME_MAX];
436436

437-
strcpy( buf, filename );
437+
expand_variables( filename, buf );
438438
filesel_add_mode( buf );
439439

440440
if( value->ii )

0 commit comments

Comments
 (0)