Ticket #1447: 0002-File-is-not-readonly-if-doesn-t-exist.patch

File 0002-File-is-not-readonly-if-doesn-t-exist.patch, 788 bytes (added by mj41, 2 years ago)
  • Padre/lib/Padre/File/Local.pm

    From 6f8f2a15020c325c756def9515e3d00568646ce8 Mon Sep 17 00:00:00 2001
    From: Michal Jurosz <mj@mj41.cz>
    Date: Sat, 11 Aug 2012 21:16:03 +0200
    Subject: [PATCH 2/4] File is not readonly if doesn't exist.
    
    It is not possible to delete file if file was deleted outside of Padre
    without this change.
    ---
     Padre/lib/Padre/File/Local.pm |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/Padre/lib/Padre/File/Local.pm b/Padre/lib/Padre/File/Local.pm
    index 0a1d6fe..f2f279b 100644
    a b sub splitall { 
    205205 
    206206sub readonly { 
    207207    my $self = shift; 
    208     return 1 if ( !-w $self->{filename} ); 
     208    return 1 if ( -e $self->{filename} && !-w $self->{filename} ); 
    209209} 
    210210 
    211211sub browse_url_join {