little optimization to make code more intuitive.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2011-10-19 13:29:30 +04:00
parent 664b3efcda
commit c6e21eff7d
3 changed files with 8 additions and 5 deletions

View File

@ -148,7 +148,7 @@ typedef struct
{
off_t got;
off_t total;
int append;
gboolean append;
} fish_fh_data_t;
/*** file scope variables ************************************************************************/
@ -908,7 +908,7 @@ fish_file_store (struct vfs_class *me, vfs_file_handler_t * fh, char *name, char
vfs_print_message (_("fish: store %s: sending command..."), quoted_name);
/* FIXME: File size is limited to ULONG_MAX */
if (!fish->append)
if (fish->append)
{
shell_commands =
g_strconcat (SUP->scr_env, "FISH_FILENAME=%s FISH_FILESIZE=%" PRIuMAX ";\n",
@ -1000,7 +1000,7 @@ fish_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset)
return 0;
quoted_name = strutils_shell_escape (name);
g_free (name);
fish->append = 0;
fish->append = FALSE;
/*
* Check whether the remote file is readable by using `dd' to copy
@ -1470,7 +1470,10 @@ fish_fh_open (struct vfs_class *me, vfs_file_handler_t * fh, int flags, mode_t m
/* File will be written only, so no need to retrieve it */
if (((flags & O_WRONLY) == O_WRONLY) && ((flags & (O_RDONLY | O_RDWR)) == 0))
{
fish->append = flags & O_APPEND;
/* user pressed the button [ Append ] in the "Copy" dialog */
if ((flags & O_APPEND) != 0)
fish->append = TRUE;
if (!fh->ino->localname)
{
int tmp_handle = vfs_mkstemps (&fh->ino->localname, me->name,

View File

@ -2,7 +2,6 @@
FILENAME="/${FISH_FILENAME}"
echo "### 001"
{
> "${FILENAME}"
bss=4096
bsl=4095
if [ $FISH_FILESIZE -lt $bss ]; then

View File

@ -2,6 +2,7 @@
FILENAME="/${FISH_FILENAME}"
echo "### 001"
{
> "${FILENAME}"
bss=4096
bsl=4095
if [ $FISH_FILESIZE -lt $bss ]; then