Skip to content

Commit

Permalink
[misc] minor update to pollock
Browse files Browse the repository at this point in the history
* Also reinstate CodeQL since github/codeql-action#850 is supposed to be fixed.
* Also fix a false Coverity warning.
  • Loading branch information
pbatard committed Jun 23, 2022
1 parent a0d6692 commit d0844bf
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Disabled on account of https://github.com/github/codeql-action/issues/850
name: "CodeQL"

on:
Expand All @@ -21,10 +20,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: cpp

Expand All @@ -37,4 +36,4 @@ jobs:
run: msbuild ${{env.SOLUTION_FILE_PATH}} /m /p:Configuration=${{ env.BUILD_CONFIGURATION}},Platform=${{ env.TARGET_PLATFORM }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
18 changes: 13 additions & 5 deletions res/loc/pollock/Pollock.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* Poedit <-> rufus.loc conversion utility
* Copyright © 2018-2019 Pete Batard <[email protected]>
* Copyright © 2018-2022 Pete Batard <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -41,9 +41,9 @@
[assembly: AssemblyDescription("Poedit ↔ Rufus loc conversion utility")]
[assembly: AssemblyCompany("Akeo Consulting")]
[assembly: AssemblyProduct("Pollock")]
[assembly: AssemblyCopyright("Copyright © 2018 Pete Batard <[email protected]>")]
[assembly: AssemblyCopyright("Copyright © 2018-2022 Pete Batard <[email protected]>")]
[assembly: AssemblyTrademark("GNU GPLv3")]
[assembly: AssemblyVersion("1.3.*")]
[assembly: AssemblyVersion("1.4.*")]

namespace pollock
{
Expand Down Expand Up @@ -266,8 +266,16 @@ static List<Language> ParseLocFile(string file, string select_id = null)
}
lang.sections[section_name].Add(new Message(parts[1], parts[2]));
// We also maintain global list of Id -> str for convenience
lang.id_to_str.Add(new Id(section_name, (parts[1])), parts[2]);
last_key = parts[1];
try
{
lang.id_to_str.Add(new Id(section_name, (parts[1])), parts[2]);
}
catch (Exception e)
{
Console.WriteLine($"Error for {parts[1]}: " + e.Message);
continue;
}
last_key = parts[1];
if (comment != null)
{
id = new Id(section_name, last_key);
Expand Down
6 changes: 5 additions & 1 deletion res/loc/pollock/Pollock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<OutputType>Exe</OutputType>
<RootNamespace>pollock</RootNamespace>
<AssemblyName>pollock</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -51,6 +52,9 @@
<ItemGroup>
<Content Include="pollock.ico" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="PostBuildMacros">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
Expand Down
3 changes: 3 additions & 0 deletions res/loc/pollock/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
1 change: 1 addition & 0 deletions src/rufus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ static char* CreateUnattendXml(int arch, int mask)
if (arch < ARCH_X86_32 || arch >= ARCH_ARM_64 || mask == 0)
return NULL;
arch--;
// coverity[swapped_arguments]
if (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, path) == 0)
return NULL;
fd = fopen(path, "w");
Expand Down
10 changes: 5 additions & 5 deletions src/rufus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.19.1900"
CAPTION "Rufus 3.19.1901"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
Expand Down Expand Up @@ -395,8 +395,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,19,1900,0
PRODUCTVERSION 3,19,1900,0
FILEVERSION 3,19,1901,0
PRODUCTVERSION 3,19,1901,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.19.1900"
VALUE "FileVersion", "3.19.1901"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.19.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.19.1900"
VALUE "ProductVersion", "3.19.1901"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit d0844bf

Please sign in to comment.