diff --git a/.gitattributes b/.gitattributes
index 96fba5029f..62fc84da40 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -18639,6 +18639,7 @@ tests/webtbs/tw38310b.pp svneol=native#text/pascal
 tests/webtbs/tw38310c.pp svneol=native#text/pascal
 tests/webtbs/tw3833.pp svneol=native#text/plain
 tests/webtbs/tw38337.pp svneol=native#text/plain
+tests/webtbs/tw38339.pp svneol=native#text/plain
 tests/webtbs/tw3840.pp svneol=native#text/plain
 tests/webtbs/tw3841.pp svneol=native#text/plain
 tests/webtbs/tw3863.pp svneol=native#text/plain
diff --git a/tests/webtbs/tw38339.pp b/tests/webtbs/tw38339.pp
new file mode 100644
index 0000000000..e81db9c9da
--- /dev/null
+++ b/tests/webtbs/tw38339.pp
@@ -0,0 +1,23 @@
+{%OPT=-O3 }
+program test48086;
+{$mode objfpc}{$H+}
+function IsFontNameXLogicalFontDesc(const LongFontName: string): boolean;
+var MinusCnt, p: integer;
+begin
+  MinusCnt:=0;
+  for p:=1 to length(LongFontName) do
+    if LongFontName[p]='-' then inc(MinusCnt);
+  Result:=(MinusCnt=14);
+end;
+var
+myfont:string;
+begin
+ myfont:='Myfont--------------';
+ if IsFontNameXLogicalFontDesc(myfont) then
+  writeln('NO ERROR')
+ else
+  begin
+    writeln('Error in count');
+    halt(1);
+  end;
+end.