From: Mohammad-Reza Nabipoor Date: Sat, 20 Dec 2025 21:40:03 +0000 (+0100) Subject: a68: fix a68_file_size X-Git-Url: https://git.feebdaed.xyz/?a=commitdiff_plain;h=74cded0be35aa0437a99a054a664a53fc1057901;p=0xmirror%2Fgcc.git a68: fix a68_file_size Fix description of function, and invocation of lseek. Signed-off-by: Mohammad-Reza Nabipoor gcc/algol68/ChangeLog * a68-parser-scanner.cc (a68_file_size): Fix comment to mention it accepts `FILE *' and not file descriptor. Fix invocation of `lseek' to correctly revert position of file offset to previous one. --- diff --git a/gcc/algol68/a68-parser-scanner.cc b/gcc/algol68/a68-parser-scanner.cc index aa67fb8d09c..94647d52882 100644 --- a/gcc/algol68/a68-parser-scanner.cc +++ b/gcc/algol68/a68-parser-scanner.cc @@ -119,7 +119,7 @@ supper_postlude[] = { } \ while (0) -/* Get the size of a file given a file descriptor FILE. In case the size of +/* Get the size of a file given a stream pointer FILE. In case the size of the file cannot be determined then this function returns -1. */ ssize_t @@ -137,7 +137,7 @@ a68_file_size (FILE *file) return -1; fsize = (ssize_t) off; - off = lseek (fileno (file), 0, save); + off = lseek (fileno (file), save, SEEK_SET); if (off == (off_t) -1) return -1;