gitlab.arm.com will be in the maintainance mode on Wednesday June 29th 01:00 - 10:00 (UTC+1). Repositories is read only during the maintainance.

Commit 7db6ecd8 authored by Supreeth Venkatesh's avatar Supreeth Venkatesh
Browse files

Fix incorrect break condition in GetLine



Change the "continue" to "break" to get a useful line and skip comments,
empty lines.
Besides above, change EOL to CRLF.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: default avatarEric Jin <eric.jin@intel.com>
Reviewed-by: default avatarSupreeth Venkatesh <supreeth.venkatesh@arm.com>
parent 0dc38d51
/** @file
Copyright 2006 - 2010 Unified EFI, Inc.<BR>
Copyright (c) 2010 Intel Corporation. All rights reserved.<BR>
Copyright (c) 2018 ARM Ltd. All rights reserved.<BR>
Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved.<BR>
Copyright (c) 2018 ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -33,7 +33,7 @@ Abstract:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
//
// Definitions
......@@ -51,7 +51,7 @@ PrintUsage (
void
);
char *
char *
Trim (
char *String
);
......@@ -161,42 +161,42 @@ PrintUsage (
}
char *
char *
Trim (
char *String
)
{
int Length;
char *end;
char *end;
Length = strlen (String);
if (!Length) {
return String;
if (!Length) {
return String;
}
end = String + Length - 1;
end = String + Length - 1;
//
// Remove the space characters from the end of this string
//
while (end >= String && isspace (*end)) {
end--;
while (end >= String && isspace (*end)) {
end--;
}
*(end + 1) = '\0';
//
// Remove the space characters from the beginning of this string
//
while (*String && isspace (*String)) {
String++;
}
*(end + 1) = '\0';
//
// Remove the space characters from the beginning of this string
//
while (*String && isspace (*String)) {
String++;
}
//
// Done
//
return String;
return String;
}
......@@ -226,15 +226,15 @@ GetLine (
//
// Remove the beginning and ending space characters
//
String = Trim (Result);
String = Trim (Result);
//
// Skip the empty line and comment line
// Skip the empty line and comment line
//
if ((String[0] == '\0') ||
(String[0] == '#' )) {
continue;
}
if ((String[0] != '\0') &&
(String[0] != '#' )) {
break;
}
}
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment