[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: macosx: Ensure setMRL trims whitespace of MRL

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon May 15 09:55:18 UTC 2023



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
a84accf6 by Claudio Cambra at 2023-05-15T09:20:52+00:00
macosx: Ensure setMRL trims whitespace of MRL

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
534b936f by Claudio Cambra at 2023-05-15T09:20:52+00:00
macosx: Ensure whitespaces are trimmed in http field before converting to UTF8

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/VLCOpenWindowController.m


Changes:

=====================================
modules/gui/macosx/VLCOpenWindowController.m
=====================================
@@ -323,7 +323,8 @@ static NSString *kCaptureTabViewId  = @"capture";
     if (!newMRL)
         newMRL = @"";
 
-    _MRL = newMRL;
+    NSString * const trimmedMRL = [newMRL stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
+    _MRL = trimmedMRL;
     [self.mrlTextField performSelectorOnMainThread:@selector(setStringValue:) withObject:_MRL waitUntilDone:NO];
     if ([_MRL length] > 0)
         [_okButton setEnabled: YES];
@@ -1041,7 +1042,7 @@ static NSString *kCaptureTabViewId  = @"capture";
             }
         }
     } else {
-        mrlString = [_netHTTPURLTextField stringValue];
+        mrlString = [_netHTTPURLTextField.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
 
         // Fixup the user-provided URI
         const char *orig_uri = [mrlString UTF8String];



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1ffa1ecfe086a86d8361dcab162862afaeb759e4...534b936fdcf59829d275fd5b82c95ebcc2fe8f5f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1ffa1ecfe086a86d8361dcab162862afaeb759e4...534b936fdcf59829d275fd5b82c95ebcc2fe8f5f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list