aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/groff/include/stringclass.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/groff/include/stringclass.h')
-rw-r--r--gnu/usr.bin/groff/include/stringclass.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/usr.bin/groff/include/stringclass.h b/gnu/usr.bin/groff/include/stringclass.h
index cf4da4bac04d..9f8523381f60 100644
--- a/gnu/usr.bin/groff/include/stringclass.h
+++ b/gnu/usr.bin/groff/include/stringclass.h
@@ -44,7 +44,7 @@ public:
string(char);
~string();
-
+
string &operator=(const string &);
string &operator=(const char *);
string &operator=(char);
@@ -53,7 +53,7 @@ public:
string &operator+=(const char *);
string &operator+=(char);
void append(const char *, int);
-
+
int length() const;
int empty() const;
int operator*() const;
@@ -75,7 +75,7 @@ public:
friend string operator+(const char *, const string &);
friend string operator+(const string &, char);
friend string operator+(char, const string &);
-
+
friend int operator==(const string &, const string &);
friend int operator!=(const string &, const string &);
friend int operator<=(const string &, const string &);
@@ -158,13 +158,13 @@ inline string operator+(char c, const string &s)
inline int operator==(const string &s1, const string &s2)
{
- return (s1.len == s2.len
+ return (s1.len == s2.len
&& (s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) == 0));
}
inline int operator!=(const string &s1, const string &s2)
{
- return (s1.len != s2.len
+ return (s1.len != s2.len
|| (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0));
}