Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove bad .gitattributes file #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sezero
Copy link
Contributor

@sezero sezero commented Aug 6, 2019

commit d3cbea4 adds a .gitattributes file with *.c ident
which corrupts the checked out fd2pragma.c, because the code
code has string checks for "$Id" and the like.

commit d3cbea4 adds a .gitattributes file with `*.c ident`
which corrupts the checked out fd2pragma.c, because the code
code has string checks for "$Id" and the like.
@sezero sezero mentioned this pull request Aug 6, 2019
@polluks
Copy link
Contributor

polluks commented Aug 8, 2019

Aha, so which error message you do get? I cannot reproduce it.

@sezero
Copy link
Contributor Author

sezero commented Aug 8, 2019

$ git clone https://github.com/adtools/fd2pragma
Initialized empty Git repository in ~/fd2pragma/.git/
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 182 (delta 0), reused 2 (delta 0), pack-reused 176
Receiving objects: 100% (182/182), 295.77 KiB, done.
Resolving deltas: 100% (101/101), done.
$ cd fd2pragma && git diff
diff --git a/fd2pragma.c b/fd2pragma.c
index 74b3a71..2f81f88 100644
--- a/fd2pragma.c
+++ b/fd2pragma.c
@@ -1258,8 +1258,7 @@ static const struct ErrField {
 {1, 0, "Format supports no M68k functions."},
 {1, 0, "Unknown type of return value."},
 {1, 0, "With SFD as input CLIB file is ignored."},
-{1, 0, "Expected $Id: in ID string."},
-{1, 0, "Expected $ at end of ID string."},
+{1, 0, "Expected $Id$ at end of ID string."},
 {1, 0, "Missing ==end."},
 {1, 1, "Expected positive decimal number."},
 {1, 0, "ID string declared twice."},
@@ -2624,13 +2623,7 @@ static uint32 ScanSFDFile(enum ABI abi)
         if(IDstring)
           DoError(ERR_IDSTRING_DECLARED_TWICE, linenum);
         IDstring = in.pos = SkipBlanks(in.pos+2);
-        if(strncmp(in.pos, "$Id: ", 5))
-        {
-          DoError(ERR_EXCPECTED_IDSTRING, linenum);
-        }
-        while(*in.pos)
-          ++in.pos;
-        if(*(in.pos-1) != '$')
+        if(strncmp(in.pos, "$Id$')
           DoError(ERR_EXPECTED_ID_ENDSIGN, linenum);
       }
       else if(!strnicmp(in.pos, "include", 7))
@@ -11385,18 +11378,7 @@ static uint32 CreateClib(uint32 callmode)
 
     if(Flags2 & FLAG2_SYSTEMRELEASE)
     {
-      DoOutput("\n/*\n**\t$Id: %s %s\n", filename, s);
-    }
-    else
-    {
-      strptr t;
-
-      t = s;
-      while(*t && *t != ' ')
-        ++t;
-      *t = 0;
-      
-      DoOutput("\n/*\n**\t$%s: %s %s (%02d.%02d.%04d)\n", "VER", filename, s,
+      DoOutput("\n/*\n**\t$Id$%s: %s %s (%02d.%02d.%04d)\n", "VER", filename, s,
       tim->tm_mday, tim->tm_mon+1, tim->tm_year+1900);
     }
     DoOutput("**\n**\tC prototypes. For use with 32 bit integers only.\n**\n**\t");
$ make
gcc -o fd2pragma -O2 fd2pragma.c
fd2pragma.c:2626:28: warning: missing terminating " character
fd2pragma.c:13728:1: error: unterminated argument list invoking macro "strncmp"
fd2pragma.c: In function ‘ScanSFDFile’:
fd2pragma.c:2626: error: expected ‘)’ at end of input
fd2pragma.c:2626: error: expected declaration or statement at end of input
fd2pragma.c:2626: error: expected declaration or statement at end of input
fd2pragma.c:2626: error: expected declaration or statement at end of input
fd2pragma.c:2626: error: expected declaration or statement at end of input
make: *** [fd2pragma] Error 1

@sezero
Copy link
Contributor Author

sezero commented Aug 8, 2019

The errors I get is with git-1.7.1 as shipped with CentOS-6.10.
Tried with a newer git (2.14.5) on a fedora-27 setup, no errors.

So it seems the issue is with older git. Still not nice, and that
old git version comes with a still-supported linux distribution.
Besides, I see no reason at all for adding that attribute, so let's
just remove it.

@sezero
Copy link
Contributor Author

sezero commented Apr 5, 2022

PING ?

@sezero
Copy link
Contributor Author

sezero commented Jun 24, 2022

PING?

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