void-packages/srcpkgs/commoncpp2/patches/ftbfs.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

24 lines
870 B
Diff

C++ does not allow specifying default arguments on friend declarations.
We can simply do this as getline is not otherwise publicly declared.
--- a/inc/cc++/string.h
+++ b/inc/cc++/string.h
@@ -731,7 +731,7 @@ public:
* @param delim deliminator to use.
* @param size optional size limitor.
*/
- friend __EXPORT std::istream &getline(std::istream &is, String &str, char delim = '\n', size_t size = 0);
+ friend __EXPORT std::istream &getline(std::istream &is, String &str, char delim, size_t size);
/**
* Stream the content of our string variable directly to a C++
@@ -743,7 +743,7 @@ public:
* Stream input into our variable.
*/
inline friend std::istream &operator>>(std::istream &is, String &str)
- {return getline(is, str);};
+ {return getline(is, str, '\n', 0);};
#ifdef HAVE_SNPRINTF
/**