From 09795a01ef859f072920de9df974d1b03b9ab9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 28 Dec 2016 20:24:50 +0100 Subject: New upstream version 4.2.4a --- app/bin/dcustmgm.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'app/bin/dcustmgm.c') diff --git a/app/bin/dcustmgm.c b/app/bin/dcustmgm.c index 53d1f96..86f86b1 100644 --- a/app/bin/dcustmgm.c +++ b/app/bin/dcustmgm.c @@ -165,8 +165,8 @@ static void CustMgmContentsOk( void * junk ) static int CustomDoExport( - const char * pathName, - const char * fileName, + int files, + char ** fileName, void * data ) { int rc; @@ -175,15 +175,18 @@ static int CustomDoExport( custMgmContext_p context = NULL; char *oldLocale = NULL; + assert( fileName != NULL ); + assert( files == 1 ); + if ( selcnt <= 0 ) return FALSE; - SetCurDir( pathName, fileName ); - rc = access( pathName, F_OK ); + SetCurrentPath( PARAMETERPATHKEY, fileName[ 0 ] ); + rc = access( fileName[ 0 ], F_OK ); if ( rc != -1 ) { - rc = access( pathName, W_OK ); + rc = access( fileName[ 0 ], W_OK ); if ( rc == -1 ) { - NoticeMessage( MSG_CUSTMGM_CANT_WRITE, _("Ok"), NULL, pathName ); + NoticeMessage( MSG_CUSTMGM_CANT_WRITE, _("Ok"), NULL, fileName[ 0 ] ); return FALSE; } custMgmProceed = TRUE; @@ -196,9 +199,9 @@ static int CustomDoExport( } if ( !custMgmProceed ) return FALSE; - customMgmF = fopen( pathName, "a" ); + customMgmF = fopen( fileName[ 0 ], "a" ); if ( customMgmF == NULL ) { - NoticeMessage( MSG_CUSTMGM_CANT_WRITE, _("Ok"), NULL, pathName ); + NoticeMessage( MSG_CUSTMGM_CANT_WRITE, _("Ok"), NULL, fileName[ 0 ] ); return FALSE; } @@ -214,7 +217,7 @@ static int CustomDoExport( context = (custMgmContext_p)wListGetItemContext( customSelL, inx ); if ( context == NULL ) continue; if (!context->proc( CUSTMGM_DO_COPYTO, context->data )) { - NoticeMessage( MSG_WRITE_FAILURE, _("Ok"), NULL, strerror(errno), pathName ); + NoticeMessage( MSG_WRITE_FAILURE, _("Ok"), NULL, strerror(errno), fileName[ 0 ] ); fclose( customMgmF ); RestoreLocale(oldLocale); return FALSE; @@ -227,7 +230,7 @@ static int CustomDoExport( } fclose( customMgmF ); RestoreLocale(oldLocale); - LoadParamFile( pathName, fileName, NULL ); + LoadParamFile( 1, fileName, NULL ); DoChangeNotification( CHANGE_PARAMS ); return TRUE; } -- cgit v1.2.3