likle / cwalk

Path library for C/C++. Cross-Platform for Linux, FreeBSD, Windows and MacOS. Supports UNIX and Windows path styles on those platforms.
https://likle.github.io/cwalk/
MIT License
250 stars 39 forks source link

fixed getting first segment #12

Closed Ilya33 closed 4 years ago

Ilya33 commented 4 years ago

Hello.

If a first segment is only one character the function cwk_path_get_previous_segment doesn't find it. Example: /n/hello_world/abc/.

This commit contains a test and fixing the problem.

Best Regards, Ilya Pavlov

codecov[bot] commented 4 years ago

Codecov Report

Merging #12 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #12   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files           1        1           
  Lines         478      478           
=======================================
  Hits          468      468           
  Misses         10       10           
Impacted Files Coverage Δ
src/cwalk.c 97.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 22be3dc...a0449a9. Read the comment docs.

likle commented 4 years ago

Hi @Ilya33 ! Thanks a lot for this fix !