Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writability of the source file is requested even when --new file must be written. #108

Open
jn0 opened this issue Jan 21, 2016 · 2 comments

Comments

@jn0
Copy link

jn0 commented Jan 21, 2016

I think, if I request a --new file, then the old one is not changed anyway.
Hence, the check for [ -z $EXTERNAL ] is not sufficient.
I'd propose [ -z $EXTERNAL -a -z $NEW ] or something similar.

@jn0
Copy link
Author

jn0 commented Jan 21, 2016

Too short to make a patch:

diff --git a/mkvdts2ac3.sh b/mkvdts2ac3.sh                                                           
index ffd6414..96d47c0 100755                                                                        
--- a/mkvdts2ac3.sh                                                                                  
+++ b/mkvdts2ac3.sh                                                                                  
@@ -339,7 +339,7 @@ if [ $EXECUTE = 1 ]; then                                                        
        elif [ ! -r "$MKVFILE" ]; then                                                               
                error $"Cannot read '$MKVFILE'."                          
                exit 1                                                                             
-       elif [ -z $EXTERNAL ]; then                                                                  
+       elif [ -z $EXTERNAL ] && [ -z $NEW ]; then                                                   
                if [ ! -w "$MKVFILE" ]; then                                
                        # Only check write permission if we're not keeping the AC3 external
                        error $"Cannot write '$MKVFILE'."                                  

@choekstr
Copy link
Collaborator

Great. Love it when people fix their own wishlists. grin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants