Skip to content

Conversation

@Nikoro
Copy link
Owner

@Nikoro Nikoro commented Nov 24, 2025

  • Windows: Replace 'tt' pattern with 'a' after retrieving format from system
  • Windows: Use dynamic buffer allocation instead of fixed 80-char buffer
  • Linux: Change %p and %r patterns to use 'a' instead of 'tt'
  • Linux: Improve performance by replacing strcat() with memcpy()
  • Linux: Add null checks and bounds checking for better memory safety
  • Linux: Fix edge case where input could end with '%'

This ensures compatibility with standard date/time format patterns used by Flutter/Dart, where 'a' represents AM/PM designator.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes AM/PM pattern representation across Windows and Linux implementations to use the standard 'a' pattern instead of 'tt', ensuring compatibility with Flutter/Dart date/time formatting conventions. The changes also include performance improvements and enhanced memory safety in the Linux implementation.

  • Converts AM/PM patterns from 'tt' to 'a' for Flutter/Dart compatibility
  • Replaces fixed-size buffer with dynamic allocation in Windows implementation
  • Refactors Linux implementation to use memcpy instead of strcat for better performance and adds safety checks

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
windows/system_date_time_format_plugin.cpp Implements dynamic buffer allocation and converts 'tt' pattern to 'a' after retrieving locale information
linux/system_date_time_format_plugin.cc Refactors format_date and format_time functions to use 'a' pattern, adds null checks, bounds checking, and replaces strcat with memcpy

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Windows: Replace 'tt' pattern with 'a' after retrieving format from system
- Windows: Use dynamic buffer allocation instead of fixed 80-char buffer
- Linux: Change %p and %r patterns to use 'a' instead of 'tt'
- Linux: Improve performance by replacing strcat() with memcpy()
- Linux: Add null checks and bounds checking for better memory safety
- Linux: Fix edge case where input could end with '%'

This ensures compatibility with standard date/time format patterns used
by Flutter/Dart, where 'a' represents AM/PM designator.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Nikoro and others added 3 commits November 24, 2025 20:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Nov 24, 2025

@Nikoro I've opened a new pull request, #30, to work on those changes. Once the pull request is ready, I'll request review from you.

Nikoro and others added 2 commits November 24, 2025 20:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…30)

* Initial plan

* Replace magic number with MAX_REPLACEMENT_LENGTH constant

Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com>

* Complete feedback implementation

Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com>

* Update linux/system_date_time_format_plugin.cc

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Nikoro <12560977+Nikoro@users.noreply.github.com>
Co-authored-by: Dominik Krajcer <dom.kraj@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Nikoro Nikoro requested a review from Copilot November 24, 2025 20:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Nikoro Nikoro merged commit ea06395 into main Nov 24, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants