summaryrefslogtreecommitdiff
path: root/app/bin/dcustmgm.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 20:24:50 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 20:24:50 +0100
commit09795a01ef859f072920de9df974d1b03b9ab9a4 (patch)
tree4d05907fc37f1bd781e506f5e196f7435aeec0ab /app/bin/dcustmgm.c
parent5b4163d8c76b03f0d31b09866aa4bd06b4d8d804 (diff)
New upstream version 4.2.4aupstream/4.2.4a
Diffstat (limited to 'app/bin/dcustmgm.c')
-rw-r--r--app/bin/dcustmgm.c23
1 files changed, 13 insertions, 10 deletions
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;
}