#include "cmd_get.h" /* self */
#include "cmd_cd.h" /* for cmdline_path_from_cwd() */
#include "main.h"
+#include "utf8.h"
/* Config: */
transfer_buffer_size=strtol(string,&endptr,0);
if (transfer_buffer_size<=0 || transfer_buffer_size>=LONG_MAX || (endptr && *endptr)) {
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_PARSING_TRANSFER_BUFFER_SIZE,
- _("Error parsing transfer buffer size: %s"),string);
+ _("Error parsing transfer buffer size: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(string));
return;
}
}
targetfile=s+1;
}
- if (-1==(fdtgt=open(targetfile,
+ if (-1==(fdtgt=open(CMD_FILENAME_FROM_UTF8_ALLOCA(targetfile),
O_CREAT|O_EXCL|O_WRONLY /* flags */
#ifdef O_BINARY
| O_BINARY
,
perm))) { /* mode */
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_CANNOT_CREATE_TARGET_HOSTOS_FILE,
- _("Cannot create target host-os file: %s"),targetfile);
+ _("Cannot create target host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile),g_strerror(errno));
return;
}
GNOME_VFS_OPEN_READ))) { /* mode */
err_cleanup(errp);
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_OPENING_SOURCE_FILE,
- _("Error opening source guest-os file '%s': %s"),sourcefile,g_strerror(errno));
+ _("Error opening source guest-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile));
goto err_close_fdtgt;
}
g_assert(errbool==FALSE);
err_cleanup(errp);
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_READING_SOURCE_FILE,
- _("Error reading source guest-os file '%s': %s"),sourcefile,g_strerror(errno));
+ _("Error reading source guest-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),g_strerror(errno));
goto err_free_transfer_buffer;
}
if (bytes_read!=(GnomeVFSFileSize)(gotssize=write(fdtgt,transfer_buffer,bytes_read))) {
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_WRITING_TARGET_HOSTOS_FILE,
- _("Error writing target host-os file: %s"),targetfile);
+ _("Error writing target host-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile));
goto err_free_transfer_buffer;
}
}
if (close(fdtgt)) {
err_cleanup(errp); /* may be clean */
g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_CLOSING_TARGET_HOSTOS_FILE,
- _("Error closing target host-os file '%s': %s"),targetfile,g_strerror(errno));
+ _("Error closing target host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile),g_strerror(errno));
}
}