Add leading blank lines check and trim redundant blank newlines

master
Peter Kokot 2018-10-01 19:52:26 +02:00 committed by Mike Frysinger
parent 906cf7ebcf
commit 434b639d53
23 changed files with 8 additions and 30 deletions

View File

@ -1,4 +1,3 @@
SET (LIBGD_SRC_FILES SET (LIBGD_SRC_FILES
bmp.h bmp.h
gd.c gd.c

View File

@ -1,4 +1,3 @@
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002 by Cold Spring Harbor Laboratory. Funded under Grant 2002 by Cold Spring Harbor Laboratory. Funded under Grant
P41-RR02188 by the National Institutes of Health. P41-RR02188 by the National Institutes of Health.

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
/* maximum number of colours that can be used. /* maximum number of colours that can be used.
actual number is now passed to initcolors */ actual number is now passed to initcolors */
#define MAXNETSIZE 256 #define MAXNETSIZE 256

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,5 +1,3 @@
/* /*
This is a header file for gd font, generated using This is a header file for gd font, generated using
bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz

View File

@ -1,5 +1,3 @@
/* /*
This is a header file for gd font, generated using This is a header file for gd font, generated using
bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz

View File

@ -1,5 +1,3 @@
/* /*
This is a header file for gd font, generated using This is a header file for gd font, generated using
bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz

View File

@ -1,5 +1,3 @@
/* /*
This is a header file for gd font, generated using This is a header file for gd font, generated using
bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz

View File

@ -1,4 +1,3 @@
/********************************************/ /********************************************/
/* gd interface to freetype library */ /* gd interface to freetype library */
/* */ /* */

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
const int gdCosT[] = { const int gdCosT[] = {
1024, 1024,
1023, 1023,

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View File

@ -1,4 +1,3 @@
if (BUILD_TEST) if (BUILD_TEST)
SET(DART_TESTING_TIMEOUT 5) SET(DART_TESTING_TIMEOUT 5)

View File

@ -14,17 +14,21 @@ import sys
def check(path): def check(path):
with open(path, 'rb') as fp: with open(path, 'rb') as fp:
# Skip 0 byte files. # Skip 0 byte files.
fp.seek(0, 2) first_byte = fp.read(1)
size = fp.tell() if not first_byte:
if size == 0:
return 0 return 0
# Check for leading blank lines.
if b'\n' == first_byte:
print('%s: trim leading blank lines' % (path,), file=sys.stderr)
return 1
# Check for missing trailing new line. # Check for missing trailing new line.
fp.seek(-1, 2) fp.seek(-1, 2)
if b'\n' != fp.read(1): if b'\n' != fp.read(1):
print('%s: missing trailing new line' % (path,), file=sys.stderr) print('%s: missing trailing new line' % (path,), file=sys.stderr)
return 1 return 1
elif size == 1: elif fp.tell() == 1:
print('%s: dummy file' % (path,), file=sys.stderr) print('%s: dummy file' % (path,), file=sys.stderr)
return 1 return 1

View File

@ -1,4 +1,3 @@
# Simple makefile for building and testing libgd under MSYS/MinGW on # Simple makefile for building and testing libgd under MSYS/MinGW on
# Windows # Windows

View File

@ -1,4 +1,3 @@
# MSYS Fallback Makefile # MSYS Fallback Makefile
This is a simple, straightforward Makefile for building LibGD with This is a simple, straightforward Makefile for building LibGD with