-
Notifications
You must be signed in to change notification settings - Fork 80
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
Line with single quote causes parsing issues #113
Comments
Lines 1362 to 1370 in 13ed93d
Setting |
You're right, for some reason it wasn't compiling the changed code after I updated it. Still, it would probably be a good idea to find a way to fail more gracefully when |
I just ran a test with your case: #[test]
fn issue113_string_no_quotes() {
let input = "
[Desktop Entry]
Version=1.0
Name[af]=Padkaart
Name[an]=Mapas
Name[ar]=الخرائط
Name=Maps
Comment[af]='n Eenvoudige padkaart-toepassing
Comment[an]=Una aplicación simpla de mapas
Comment[ar]=تطبيق خرائط بسيط
Comment=A simple maps application
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gapplication --file-forwarding org.gnome.Maps launch org.gnome.Maps @@u %U @@
Icon=org.gnome.Maps
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;
";
let ini = Ini::load_from_str_opt(input,
ParseOption { enabled_quote: false,
..Default::default() }).unwrap();
assert_eq!(ini.get_from(Some("Desktop Entry"), "Exec"), Some("/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gapplication --file-forwarding org.gnome.Maps launch org.gnome.Maps @@u %U @@"));
} which worked perfectly as expected:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take for example, this file:
Because of the line
Comment[af]='n Eenvoudige padkaart-toepassing
, if Ilet command = match section.get("Exec")
it will returnNone
. Settingoption.enabled_quote
totrue
orfalse
doesn't seem to make a difference.The text was updated successfully, but these errors were encountered: